3.5.5.1.1.1 When ConnectionState is Connecting (last handshake response)

The Polling-POST-Response message of the polling handshake MUST have a Polling-POST-Response-Entity-Body that contains application data.

The client validates the Polling-POST-Response message, as specified in section 2.2.4.2, as follows:

1. The client MUST validate the polling Polling-Virtual-Connection-Message, as specified in section 2.2.4.1.3.1, and extract the version, server name, virtual connection GUID, sequence number and checksum. If parsing fails, it is a protocol error and the server MUST close the connection, as specified in section 3.5.4.2. The sequence number value is saved in the variable ResponseSequenceNum.

2. The client SHOULD<44> check the Polling-Encapsulation-Version and, if the version does not equal the required value (see section 2.2.4.1.3.1.1), close the polling virtual connection, as specified in section 3.5.4.2.

3. The client SHOULD<45> verify that the server name in the message equals its own name and, if the names are not equal, close the virtual connection.

4. The client MUST examine the Virtual-Connection-GUID to validate that it is found in the VirtualConnectionGUIDList. Otherwise it is a protocol error, and the client MUST close the polling connection, as specified in section 3.5.4.2.

5. The Sequence-Number MUST be verified and stored in the ResponseSequenceNum. The sequence number MUST be zero ("0").

6. The Checksum field MUST be calculated with the application data and verified as specified in section 2.2.4.1.3.1.3.

The receipt of application data on the POST session completes POST session establishment. The client sets PostSessionState and ConnectionState both to "Established".

The ConnectionEstablishment timer is stopped and no further timer expiration processing is performed.

The Polling Encapsulation Poll timer MUST be started if there is no application data to send now.

The clients sets the ClientOKtoSend state variable to "true".

The client MUST close the POST session as specified in section 3.5.5.1.5.

The application data is passed to the application layer to be processed and consumed.

The client is ready to send application data. If there is any buffered data to send, the client MUST send it now, as specified in section 3.5.4.3.