+ if (output_mask & yaz_poll_write)
+ mask |= SOCKET_OBSERVE_WRITE;
+
+ if (output_mask & yaz_poll_except)
+ mask |= SOCKET_OBSERVE_EXCEPT;
+
+ if (mask)
+ {
+ SocketEvent *event = new SocketEvent;
+ p->last_activity = now;
+ event->observer = p->observer;
+ event->event = mask;
+ putEvent (event);
+ no_put_events++;
+ yaz_log (m_log, "putEvent I/O mask=%d", mask);
+ }
+ else if (res == 0 && p->timeout_this == timeout)
+ {
+ SocketEvent *event = new SocketEvent;
+ assert (p->last_activity);
+ yaz_log (m_log, "putEvent timeout fd=%d, now = %ld last_activity=%ld timeout=%d",
+ p->fd, now, p->last_activity, p->timeout);
+ p->last_activity = now;
+ event->observer = p->observer;
+ event->event = SOCKET_OBSERVE_TIMEOUT;
+ putEvent (event);
+ no_put_events++;
+
+ }
+ }
+ SocketEvent *event = getEvent();
+ if (event)