Programmer-defined events

An application defines programmer-defined events with srv_define_event and installs them with srv_handle. The application must call srv_event or srv_event_deferred to place the new event on the client’s event queue.

The default programmer-defined event handler sends a message to the client stating that there is no handler installed. The message includes the event number and name.

Programmer-defined events can be used to provide services to other threads in the Open Server application. For example, such an event could allow threads to log transactions in a disk file. To set up this service, define the event with srv_define_event, install a handler routine that writes to the disk file, and create a service thread to which the events are queued. The service thread provides the transaction-logging code.