2.2.1.6 Attention

The client can interrupt and cancel the current request by sending an Attention message. This is also known as out-of-band data, but any TDS 4.2 packet (request) that is currently being sent MUST be completely sent before sending the Attention message. After the client sends an Attention message, the client MUST read until it receives an Attention acknowledgment.

If a complete request has been sent to the server, sending a cancel request requires sending an Attention packet. An example of this behavior is when the client has already sent a request, which has the last packet with the EOM bit (0x01) set in the status. The Attention packet is the only way to interrupt a complete request that has already been sent to the server. See section 2.2.4.4.2 for additional details.

If a complete request has not been sent to the server, the client MUST send the next packet with both the ignore bit (0x02) and EOM bit (0x01) set in the status to cancel the request. An example of this behavior is when one or more packets have been sent but the last packet with the EOM bit (0x01) set in the status has not been sent. Setting the ignore and EOM bits terminates the current request, and the server MUST ignore the current request. When the ignore and EOM bits are set, the server will not send an Attention acknowledgment but instead return a table response with a single DONE token with a status of DONE_ERROR to indicate the incoming request was ignored. See section 2.2.3.1.2 for additional details about the buffer header status code.