3.6.5.3 Receiving a Polling-POST-Request (After Handshake)

Polling-POST-Request events that are received while the virtual Polling Connection is in the 'Established' state define how the server processes application data and Poll requests.

Once the ConnectionState is in the 'Established' state all Polling-POST-Requests MUST contain Application data, otherwise it is a protocol error, and the server MUST close the virtual polling connection as specified in section 3.6.4.1.

The server MUST validate the Polling-Virtual-Connection-Message (see section 2.2.4.1.3.1) using the following steps:

  1. The Polling-POST-Request Sequence-Number field value on the received message SHOULD be compared against the expected Sequence-Number found in the RequestSequenceNum connection variable. Non-valid values are protocol errors. The new Sequence-Number SHOULD be stored in the RequestSequenceNum.

  2. The Polling-POST-Request Checksum field value MUST be calculated over the length of the application data received on each Polling-POST-Request message received, as specified in section 2.2.4.1.3.1.3. The calculated Checksum value MUST be equal to the Checksum value found in the Polling-POST-Request field. If there is no application data, the Checksum MUST be 0.

The server validates the presence of application data by examining the Polling-Content-Length value. Application data MUST be present when the content length is greater than the length of the Polling-Virtual-Connection-Message.

If any of the preceding validation procedures fail, the virtual Polling Connection MUST be closed as specified in section 3.6.4.1.

Any application data is handed off to the application layer for further processing.

The server MUST respond to the Polling-POST-Request message with a Polling-POST-Response message containing a status code of 200, as specified in section 3.6.5.2.1. If the server has no buffered application data to send on the Polling-POST-Response, then it MUST send the Polling-POST-Response (see section 3.6.5.2.1) with no application data.