Using regular passthrough mode

Regular TDS passthrough takes place inside any event handler except SRV_ATTENTION, SRV_CONNECT, SRV_DISCONNECT, SRV_START, or SRV_STOP.

Client requests arrive in a stream of one or more TDS packets. The handler repeatedly calls srv_recvpassthru as long as the info argument remains set to SRV_I_PASSTHRU_MORE. As each packet is received, the handler calls ct_sendpassthru to pass the packet on to the remote Adaptive Server or Open Server. The remote server receives exactly the same TDS stream it would receive from a directly connected client.

WARNING! The latest version of TDS introduces multiple commands in a single batch. Only the first command triggers an event handler. Open Server will not call event handlers for the remaining commands.

A Client-Library routine, ct_recvpassthru, receives the TDS packets as they arrive at the connection. The srv_sendpassthru Server-Library routine sends the packet on to the client. The ct_recvpassthru routine retrieves another TDS packet as long as it returns CS_PASSTHRU_MORE.