3.7.5.4 Connection Close
The sequential processing rules for closing a connection initiated by the client are as follows:
The channel MUST be in the CHANNEL_STATE_CREATED state. The RDG client sends an HTTP_CLOSE_PACKET to the RDG server with packetType set to PKT_TYPE_CLOSE_CHANNEL. The client MUST NOT send any more data on the channel after this.
The RDG client waits for an HTTP_CLOSE_PACKET from the RDG server with packetType set to PKT_TYPE_CLOSE_CHANNEL_RESPONSE and discards any other channel data it receives. Nonchannel data such as service messages are received and processed as usual.
After receiving HTTP_CLOSE_PACKET from the RDG server with packetType as PKT_TYPE_CLOSE_CHANNEL_RESPONSE, the RDG client closes the channel.
The sequential processing rules for closing a connection initiated by the server are as follows:
The channel MUST be in CHANNEL_STATE_CREATED state. The RDG client receives a HTTP_CLOSE_PACKET from the RDG server with packetType set to PKT_TYPE_CLOSE_CHANNEL. The client MUST NOT send or receive any more data on the channel after this.
The RDG client sends an HTTP_CLOSE_PACKET to RDG server with packetType set to PKT_TYPE_CLOSE_CHANNEL_RESPONSE, and closes the channel.
The sequential processing rules for closing a tunnel initiated by the client are as follows:
The tunnel state MUST be less than TUNNEL_STATE_CANCEL_TUNNEL_CREATE_OR_AUTH and greater than TUNNEL_STATE_CONNECT_IN_PROGRESS. The RDG client closes all channels inside the tunnel.
The RDG client closes the HTTP connection for OUT and IN channels.
The sequential processing rules for closing a tunnel initiated by the server are as follows:
The tunnel (2) state MUST be less than TUNNEL_STATE_CANCEL_TUNNEL_CREATE_OR_AUTH and greater than TUNNEL_STATE_CONNECT_IN_PROGRESS. The RDG client receives a disconnect notification from HTTP.
The RDG client closes all the channels inside the tunnel without sending an HTTP_CLOSE_PACKET packet to the RDG server or waiting for HTTP_CLOSE_PACKET.