3.6.5.2.1 Sending a Polling-POST-Response with Status code 200 (OK)

A Polling-POST-Response message with a status code of "200" is sent as a successful response to the second and last Polling-Post-Request of the polling connection handshake or as a successful response to a Polling-POST-Request after the handshake.

If ConnectionState is "Connected", the Sequence-Number field specified on the Polling-Virtual-Connection-Message uses the value of ResponseSequenceNum, which is set to zero. If ConnectionState is "Established", the ResponseSequenceNum field is incremented by 1 and used as the Sequence-Number field value.

The Polling-POST-Response MUST include a Response-Status-Line, as specified in section 2.2.2.3.1, with a status code of 200 and a phrase of "OK".

The Polling-POST-Response-Required-Headers MUST be included.

The Polling-Virtual-Connection-Message MUST be prepared using the ServerHost as Relay-Server-Name, and VirtualConnectionGUID as Virtual-Connection-GUID. The Polling-POST-Request Checksum field value MUST be calculated (see section 2.2.4.1.3.1.3) over the length of the application data that is to be sent. If there is no application data to send, the Checksum field MUST be set to 0.

All buffered application data and any new application data SHOULD be included in the Polling-POST-Response-Entity-Body. If there is no application data to send, the Polling-POST-Response message MUST be sent without application data. If the content length would exceed the 32768 size limit, the Polling-Response-Entity-Body MUST be broken into 32768 chunks.

The Polling-Virtual-Connection-Response-Message MUST be prepared using the PollingMinRepetitionInterval, PollingMinRepetitionInterval, and PollingRepetitionCount connection state variables. Server implementations MAY use various load balancing techniques to control the clients poll timer interval (see section 3.5.2.3)<52>.

The Polling-Content-Length is set to the length of the Polling-Virtual-Connection-Response-Message plus the length of the buffered application data.

 If there is no application data to send, the Polling time MUST be started with the current polling interval.

The Polling-POST-Response MUST be sent on the POST session. The Polling session MUST be closed (see section 3.6.4.2).