3.2.5 Message Processing Events and Sequencing Rules

The processing of messages received from a TDS server depends on the message type and the current state of the TDS client. The rest of this section describes the processing and actions to take on them. The message type is determined from the TDS packet type and the token stream inside the TDS packet payload, as described in section 2.2.3.

Whenever the TDS client enters either the "Logged In" state or the "Final State" state, it MUST stop the Connection Timer (if implemented and running), the Client Request Timer (if implemented and running), and the Cancel Timer (if implemented and running).

Whenever a TDS client receives a structurally invalid TDS message, it MUST close the underlying transport connection, indicate an error to the upper layer, and enter the "Final State" state.

When a TDS client receives a table response (TDS packet type %x04) from the server, it MUST behave as follows, according to the state of the TDS client.

The corresponding action will be taken when the server is in the following states. In the following processing and actions, aspects that do not apply to both TDS 7.x and TDS 8.0 are explicitly identified in the text.