CONNECTION_STATE_TYPE
Network connection state.
Enumerations
- CONNECTION_STATE_DISCONNECTED
- 1: Network disconnected. This state indicates the SDK is:
- In the initialization phase before calling JoinChannel [2/2].
- Or in the leave phase after calling LeaveChannel [2/2].
- CONNECTION_STATE_CONNECTING
- 2: Connecting to the network. This state indicates the SDK is establishing a connection to the specified channel after calling JoinChannel [2/2].
- If the channel is joined successfully, the app receives the OnConnectionStateChanged callback indicating the state changes to CONNECTION_STATE_CONNECTED.
- After the connection is established, the SDK initializes media and then triggers OnJoinChannelSuccess when ready.
- CONNECTION_STATE_CONNECTED
- 3: Network connected. This state indicates the user has joined the channel and can publish or subscribe to media streams. If the connection is interrupted due to network issues or switching, the SDK automatically reconnects. The app receives the OnConnectionStateChanged callback indicating the state changes to CONNECTION_STATE_RECONNECTING.
- CONNECTION_STATE_RECONNECTING
- 4: Reconnecting to the network. This state indicates the SDK had previously joined the channel but got disconnected due to network issues. The SDK automatically attempts to rejoin the channel.
- If the SDK fails to rejoin within 10 seconds, OnConnectionLost is triggered. The SDK remains in CONNECTION_STATE_RECONNECTING and keeps trying to rejoin.
- If the SDK fails to rejoin within 20 minutes, the app receives the OnConnectionStateChanged callback indicating the state changes to CONNECTION_STATE_FAILED, and the SDK stops trying to reconnect.
- CONNECTION_STATE_FAILED
- 5: Network connection failed. This state indicates the SDK has stopped trying to rejoin the channel. You need to call LeaveChannel [1/2] to leave the channel.
- If the user wants to rejoin, call JoinChannel [2/2] again.
- If the SDK is prevented from joining by the server using RESTful API, the app receives OnConnectionStateChanged.