3.2.3 RPC over HTTP Transport - RDG Server States

Connection State: An enumeration of different connection states. This is updated as per the state transition rules mentioned in section 3.2.6. The following diagram represents the connection state transition.

The RDG server MUST use this ADM element to verify that the call sequence is not violated. In each state the allowed calls and the state transitions therefore are described in this section. Section 3.2.6 describes the returns values and errors for each method call.

Each connection goes through a set of states as described in this section.

State transition diagram

Figure 13: State transition diagram

Start: By default, the protocol starts in a disconnected state.

Connected: A successful TsProxyCreateTunnel call brings the connection to the Connected state. Once a connection is in a Connected state, a TsProxyCloseTunnel call can be made to bring the connection to the Disconnected state.

Authorized: A successful TsProxyAuthorizeTunnel call brings the connection to the Authorized state. A TsProxyAuthorizeTunnel call can only be made when the connection is in a Connected state. If a TsProxyAuthorizeTunnel call is made in any other state, then the result is undefined. The TsProxyMakeTunnelCall call is allowed in this state. This call does not change the state. TsProxyCloseTunnel can also be made in this state, which moves the connection to the Disconnected state.

Channel Created: A successful TsProxyCreateChannel call brings the connection to the Channel Created state. A TsProxyCreateChannel call is valid only when the tunnel is authorized. If a TsProxyCreateChannel call is made before the tunnel (2) is authorized, ERROR_ACCESS_DENIED will be returned. TsProxyCloseChannel can also be made in this state, which moves the connection to the Tunnel Close Pending state. The TsProxySetupReceivePipe call is valid only in this state. If this call is made before the RDG client calls TsProxyCreateChannel, ERROR_ACCESS_DENIED will be returned. If it is made after the call to TsProxyCloseChannel, E_PROXY_ALREADYDISCONNECTED will be returned.

The TsProxyMakeTunnelCall call is allowed in this state. This call does not change the state.

When TsProxyCloseTunnel is called in this state before a call to TsProxyCloseChannel, the RDG server closes the channel and completes the TsProxyCloseTunnel call. After completing this call, the RDG server moves to the End state.

Pipe Created: When a call to TsProxySetupReceivePipe reaches the RDG server, the connection goes to the Pipe Created state. The TsProxySendToServer call is valid only in this state. If this call is made before the RDG client calls TsProxySetupReceivePipe, ERROR_ACCESS_DENIED will be returned. If it is made after the call to TsProxyCloseTunnel, E_PROXY_ALREADYDISCONNECTED will be returned.

The TsProxyMakeTunnelCall call is allowed in this state. This call does not change the state.

When TsProxyCloseTunnel is called in this state before a call to TsProxyCloseChannel, the RDG server closes the channel and completes the TsProxyCloseTunnel call. After completing this call, the RDG server moves to the End state.

Channel Close Pending: From Pipe Created state, either a final response to TsProxySetupReceivePipe call or a failure in TsProxySendToServer call brings the connection to the Channel Close Pending state. TsProxyCloseChannel, TsProxyMakeTunnelCall, and TsProxyCloseTunnel calls are the only valid calls in this state.

When TsProxyCloseTunnel is called in this state before a call to TsProxyCloseChannel, the RDG server closes the channel and completes the TsProxyCloseTunnel call. After completing this call, the RDG server moves to the End state.

Tunnel Close Pending: Either a failure TsProxyAuthorizeTunnel call from Connected state or a successful TsProxyCloseChannel call from Channel Close Pending state brings the connection to Tunnel Close Pending state. If a previous TsProxyMakeTunnelCall has not completed, then another call to TsProxyMakeTunnelCall MUST be made as specified in section 3.2.6.3.2. The TsProxyCloseTunnel call SHOULD be made by the RDG client to end the protocol.

End: The RDG server MUST transition to this state when the TsProxyCloseTunnel method is called. At this stage, the connection between the RDG client and the RDG server is disconnected.