srv_post_handle

Installs a post-event handler for an extended stored procedure called after the standard event handler.


Important This Open Data Services function or macro is only supported in Microsoft® SQL Server™ version 7.0 for backward compatibility.


For more information about Open Data Services functions or macros supported for backward compatibility, see Open Data Services (Level 3).

Syntax

int srv_post_handle (
SRV_SERVER * server,
SRV_PROC * srvproc,
DBINT event,
SRV_POST_HANDLE_PROC handler,
BOOL remove );

Arguments
server
Is a pointer to the SRV_SERVER structure. Use srv_init to get this pointer. If you provide a server value, you must provide a null srvproc value.
srvproc
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The srvproc parameter contains information the ODS Library uses to manage communication and data between the application and the client.

If you provide a srvproc value, you must provide a null server value.

event
Specifies the event assigned to handler. If you provide a server value, all events are valid. If you provide a srvproc value, the following client-generated events are valid:

When a SRV_DISCONNECT event occurs, the srvproc passed to the post-event handler is valid, but the connection is disconnected.

handler
Is a pointer to the function called after the standard event handler (installed by srv_handle) when the event defined by event occurs.

This function should be defined as returning an int variable and taking a single parameter. This parameter should be defined as SRV_SERVER * when event is one of the following:

It should be 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.

remove
Is a Boolean flag that determines if the specified handler should be installed or removed. Use FALSE to install a new handler value for event. Use TRUE to remove an existing handler value for event.
Returns

A pointer to the previously defined post-event-handling function.

Remarks

When an event occurs, Open Data Services calls the following functions in this order:

  1. The pre-event handler (installed by srv_pre_handle).
  2. The standard event handler (installed by srv_handle).
  3. The post-event handler (installed by srv_post_handle).

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 automatically removes the post-event handler when necessary; the application should not attempt to do this.

See Also
srv_handle  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.