ConnectionStateType enum

Connection states.

Inheritance

Constructors

ConnectionStateType()
const

Values

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.
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.
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:

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.
Failed → const ConnectionStateType

The SDK fails to connect to Agora's edge server or join the channel. You must call RtcEngine.leaveChannel to leave this state, and call RtcEngine.joinChannel again to rejoin the channel.

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.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ConnectionStateType>
A constant List of the values in this enum, in order of their declaration.