This section describes using Hummer SDK to determine server connection status.
Statuses for connection to the server network are as depicted below:
Get the changes of connection status with the server via the callback onUpdateChannelState
:
The operations for SDK triggering the onUpdateChannelState
are as follows:
- After the SDK method
init
is successfully called, the connections status notified by the callback changes fromDisconnected
toConnecting
.
- After the SDK method
open
is successfully called, the connections status notified by the callback changes fromConnecing
toConnected
.
- After disconnection from the server is detected, the SDK notifies the connection status as
Disconnected in the callback
.
You can communicate with background developers to set the maximum elapsed time between disconnection and reconnection. Once connection is established between the SDK and the server, your device disconnecting and reconnecting to the network will generate one of these two results:
Your device will restore connection to the network within the specified time period. The SDK will reconnect to the server and trigger callback onUpdateChannelState
, for which connection status will change from Disconnected
to Connecting
. After successful connection with the server, status will change again from Connecting
to Connected
.
Device network reconnection times out, and the SDK will no longer connect to the server.