ConnectionStateType enum Null safety
- Connected → const ConnectionStateType
The SDK is connected to Agora's edge server and joins a channel. You can now publish or subscribe to a media stream in the channel. If the connection to the channel is lost because, for example, the network is down or switched, the SDK automatically tries to reconnect and triggers:
- The RtcEngineEventHandler.connectionStateChanged callback, and switches to the ConnectionStateType.Reconnecting state.
- Connecting → const ConnectionStateType
The SDK is connecting to Agora's edge server.
- When the app calls RtcEngine.joinChannel, the SDK starts to establish a connection to the specified channel, triggers the RtcEngineEventHandler.connectionStateChanged callback, and switches to the ConnectionStateType.Connecting state.
- When the SDK successfully joins the channel, the SDK triggers the RtcEngineEventHandler.connectionStateChanged callback and switches to the ConnectionStateType.Connected state.
- After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the RtcEngineEventHandler.joinChannelSuccess callback.
- Disconnected → const ConnectionStateType
The SDK is disconnected from Agora's edge server.
- This is the initial state before RtcEngine.joinChannel.
- The SDK also enters this state when the app calls RtcEngine.leaveChannel.
- Failed → const ConnectionStateType
If the SDK is banned from joining the channel by Agora’s edge server (through the RESTful API), the SDK triggers the RtcEngineEventHandler.connectionStateChanged callbacks.@JsonValue(5)
- Reconnecting → const ConnectionStateType
The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.
- If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora’s edge server, the SDK triggers the RtcEngineEventHandler.connectionLost callback, stays in the ConnectionStateType.Reconnecting state, and keeps rejoining the channel.
- If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora’s edge server, the SDK triggers the RtcEngineEventHandler.connectionStateChanged callback, switches to the ConnectionStateType.Failed state, and stops rejoining the channel.
→ const List<
A constant List of the values in this enum, in order of their declaration.