Waiting on Events with isc_wait_for_event()
Go Up to Working with Events
After setting up EPBs and specifying events of interest with
isc_event_block(), an application can use
isc_wait_for_event() to register interest in those events and pause its execution until one of the events occurs.
The syntax for
ISC_STATUS isc_wait_for_event(ISC_STATUS *status_vector, isc_db_handle *db_handle, short length, char *event_buffer, char *result_buffer);
For example, the following code sets up EPBs for three events, then calls
isc_wait_for_event() to suspend its execution until one of the events occurs:
#include <ibase.h>; . . . char *event_buffer, *result_buffer; long blength; ISC_STATUS status_vector; isc_db_handle db1; . . . /* Assume database db1 is attached here and a transaction started. */ blength = isc_event_block(&event_buffer, &result_buffer, 3, "BORL", "INTEL", "SUN"); isc_wait_for_event(status_vector, &db1, (short)blength, event_buffer, result_buffer); /* Application processing is suspended here until an event occurs. */ . . .
isc_wait_for_event() is called, application processing stops until one of the requested events is posted. When the event occurs, application processing resumes at the next executable statement following the call to
isc_wait_for_event(). If an application is waiting on more than one event, it must use
isc_event_counts() to determine which event was posted.
See Isc wait for event() for its complete syntax