Installs a post-event handler for an extended stored procedure that is called after the standard event handler.
int srv_post_handle (
SRV_SERVER * server,
SRV_PROC * srvproc,
DBINT event,
SRV_POST_HANDLE_PROC handler,
BOOL remove );
where
If you provide a srvproc value, you must provide a NULL server value.
When a SRV_DISCONNECT event occurs, the srvproc passed to the post-event handler is valid, but the connection is disconnected.
If a server value is provided, this function is global to the Open Data Services application and will be called (after the standard event handler) every time event occurs.
If a srvproc value is provided, this function will be called (after the standard event handler) only when event is generated by the srvproc client connection.
This function should be defined as returning an int and taking a single parameter. This parameter should be defined as SRV_SERVER * when event is one of the following:
and defined as SRV_PROC * when event is one of the following:
This function must return one of the following values:
Return value | Description |
---|---|
SRV_CONTINUE | Continue normal processing. |
SRV_DISCONNECT | Fire a disconnect event to close the client connection. |
SRV_EXIT | Fire a disconnect event to close the client connection. |
SUCCEED, FAIL, or SRV_DUPLICATE_HANDLER. SRV_DUPLICATE_HANDLER is returned if you attempt to install the same post-event handler function multiple times for the same event.
When an event occurs, Open Data Services calls the following functions in this order:
You can install post-event handlers dynamically. The new post-event handler is called when the next event occurs. For each event, an extended stored procedure application can have multiple global post-event handlers, and multiple post-event handlers per client connection, but you cannot install the same post-event handler function multiple times for the same event. Open Data Services will automatically remove the post-event handler when necessary; your program should not attempt to do this.
This entry | For information about |
---|---|
srv_handle | Installing a standard event handler |
srv_pre_handle | Installing a pre-event handler |