Detecting connection problems
A client can automatically detect if there are problems with its connection to the Diffusion™ server and take action to handle any disconnection.
When a client detects that it has become disconnected from
the
Diffusion
server
, the session state changes from CONNECTED to one
of the following states:
- If reconnection is enabled at the client and at the Diffusion server , the session state changes to RECOVERING.
- If reconnection is not enabled, the session state changes to DISCONNECTED.
The client can detect that it has become disconnected from the Diffusion server using the following methods:
Monitoring the connection activity
The client automatically monitors the activity between the client and the Diffusion server and uses this information to quickly discover any connection problems.
Using TCP state
Depending on the transport the client uses to connect to
the
Diffusion
server
, the client can use the TCP state to detect
whether to change its state from CONNECTED to one of RECOVERING or DISCONNECTED.
- WebSocket: The client uses the TCP state to detect whether to trigger a state change.
- HTTP Polling: The client uses the TCP state at certain points during an HTTP request to detect whether to trigger a state change.