srv_event

Activates a client event.

Syntax

int srv_event (
SRV_PROC
* srvproc,
int
event,
void *
data );

where

srvproc
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The structure contains all the information that the Data Services Library uses to manage communications and data between the Open Data Services server application and the client.
event
Indicates the event to activate. This value can be SRV_DISCONNECT, SRV_EXIT, or SRV_STOP.
data
Is a pointer to data supplied by the Open Data Services developer. The data is available in the event handler for the specified event when srv_event is called. It is accessed with SRV_EVENTDATA. The pointer can be NULL.

Returns

The value of the requested event, or -1 if an error occurs.

Remarks

Events are usually activated automatically based on client and server requests. However, events can be activated from within an Open Data Services server application by using srv_event.

Only these events can be invoked using srv_event:

The srv_handle function specifies which event handler to call when an event occurs. If no handler is defined for a particular event, the Open Data Services server application's default event handler is called.

Data can be passed to event handlers or to any event. The data is made available with the SRV_EVENTDATA macro.

To activate an ODS event without a SRV_PROC client connection, call the srv_setevent function.

See Also

This entry For information about
SRV_EVENTDATA Accessing event-handler data
srv_handle Installing an event handler
srv_setevent Activating a global ODS event