ConnectionStateType enum

Connection states.

Inheritance

Constructors

ConnectionStateType()
const

Values

Disconnected → const ConnectionStateType

1: The SDK is disconnected from the Agora edge server. The state indicates the SDK is in one of the following phases: The initial state before calling the joinChannel method. The app calls the leaveChannel method.

Connecting → const ConnectionStateType

2: The SDK is connecting to the Agora edge server. This state indicates that the SDK is establishing a connection with the specified channel after the app calls joinChannel. If the SDK successfully joins the channel, it triggers the connectionStateChanged callback and the connection state switches to Connected. After the connection is established, the SDK also initializes the media and triggers joinChannelSuccess when everything is ready.

Connected → const ConnectionStateType

3: The SDK is connected to the Agora edge server. This state also indicates that the user has joined a channel and can now publish or subscribe to a media stream in the channel. If the connection to the Agora edge server is lost because, for example, the network is down or switched, the SDK automatically tries to reconnect and triggers connectionStateChanged that indicates the connection state switches to Reconnecting.

Reconnecting → const ConnectionStateType

4: The SDK keeps reconnecting to the Agora edge server. 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, it triggers connectionLost , stays in the Reconnecting state, and keeps rejoining the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from the Agora edge server, the SDK triggers the connectionStateChanged callback, switches to the Failed state, and stops rejoining the channel.

Failed → const ConnectionStateType

5: The SDK fails to connect to the Agora edge server or join the channel. This state indicates that the SDK stops trying to rejoin the channel. You must call leaveChannel to leave the channel. You can call joinChannel to rejoin the channel. If the SDK is banned from joining the channel by the Agora edge server through the RESTful API, the SDK triggers the connectionStateChanged callback.

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.