10. Events

If you're developing non-blocking applications, you have to deal with events.

    int ZOOM_event(int no, ZOOM_connection *cs);
   

The ZOOM_event executes pending events for a number of connections. Supply the number of connections in no and an array of connections in cs (cs[0] ... cs[no-1]). A pending event could be sending a search, receiving a response, etc. When an event has occurred for one of the connections, this function returns a positive integer n denoting that an event occurred for connection cs[n-1]. When no events are pending for the connections, a value of zero is returned. To ensure that all outstanding requests are performed, call this function repeatedly until zero is returned.

If ZOOM_event returns, and returns non-zero, the last event that occurred can be expected.

    int ZOOM_connection_last_event(ZOOM_connection cs);
   

ZOOM_connection_last_event returns an event type (integer) for the last event.

Table 3.13. ZOOM Event IDs

EventDescription
ZOOM_EVENT_NONENo event has occurred
ZOOM_EVENT_CONNECTTCP/IP connect has initiated
ZOOM_EVENT_SEND_DATAData has been transmitted (sending)
ZOOM_EVENT_RECV_DATAData has been received
ZOOM_EVENT_TIMEOUTTimeout
ZOOM_EVENT_UNKNOWNUnknown event
ZOOM_EVENT_SEND_APDUAn APDU has been transmitted (sending)
ZOOM_EVENT_RECV_APDUAn APDU has been received
ZOOM_EVENT_RECV_RECORDA result-set record has been received
ZOOM_EVENT_RECV_SEARCHA search result has been received