4.4 TDI Client Callbacks

Most TDI clients' routines are highly variable and environment-dependent. However, TDI defines a set of callback routines that clients can register with the underlying TDI transport to receive notifications when network events of interest occur. A kernel-mode TDI client can register any of these ClientEventXxx routines if the TDI driver is to notify it of a particular type of network event occurrence. The client can even use such a registered ClientEventXxx handler as an alternative to issuing certain TDI_XXX IOCTL requests to the driver.

Like the TdiDispatchXxx routines described already, the client-supplied event handlers can have any names the client writer chooses. Each ClientEventXxx mentioned here is registered as an entry point passed in a client-submitted IRP to the TdiDispatchInternalDeviceControl routine.

A TDI client can have one or more of the callbacks listed next, registered at the beginning of network operations on an open transport address with the TDI transport driver by issuing successive TDI_SET_EVENT_HANDLER requests, set up with TdiBuildSetEventHandler:

ClientEventConnect 
Notifies the client of a connection offer from a remote-node peer process.
ClientEventDisconnect 
Notifies the local-node client that its remote-node peer is terminating the endpoint-to-endpoint connection between them.
ClientEventError 
Notifies the client of an error condition in its underlying transport driver, in one of the lower protocol layers of the transport stack, or in a still lower NDIS driver that has made subsequent I/O on the client's open transport address unreliable or impossible.
ClientEventReceive 
Notifies the client that its transport has received normal data from the remote-node peer on an endpoint-to-endpoint connection and makes all or part of the received data available to be copied by the client.
ClientEventChainedReceive
Notifies the client that its transport has received a normal TSDU from the remote-node peer on an endpoint-to-endpoint connection and makes the full TSDU available for consumption by the client.
ClientEventReceiveExpedited
Notifies the client that its transport has received expedited data from the remote-node peer on an endpoint-to-endpoint connection and makes all or part of the received data available to be copied by the client.
ClientEventChainedReceiveExpedited
Notifies the client that its transport has received an expedited TSDU from the remote-node peer on an endpoint-to-endpoint connection and makes the full TSDU available for consumption by the client.
ClientEventReceiveDatagram 
Notifies the client that the TDI driver has received a datagram directed to a transport address that the client has opened.
ClientEventChainedReceiveDatagram
Notifies the client that the TDI driver has received a datagram directed to a transport address that the client has opened and makes the full TSDU available for consumption by the client.
ClientEventSendPossible 
Notifies the client that the transport, which buffers send data internally, again has buffer space available for sends.