ConnectionChangedReasonType

Reasons causing the change of the connection state.

Enumerator

connectionChangedConnecting
0: The SDK is connecting to the Agora edge server.
connectionChangedJoinSuccess
1: The SDK has joined the channel successfully.
connectionChangedInterrupted
2: The connection between the SDK and the Agora edge server is interrupted.
connectionChangedBannedByServer
3: The connection between the SDK and the Agora edge server is banned by the Agora edge server. For example, when a user is kicked out of the channel, this status will be returned.
connectionChangedJoinFailed
4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this code will be returned and the SDK stops reconnecting to the channel. You need to prompt the user to try to switch to another network and rejoin the channel.
connectionChangedLeaveChannel
5: The SDK has left the channel.
connectionChangedInvalidAppId
6: The App ID is invalid. You need to rejoin the channel with a valid APP ID and make sure the App ID you are using is consistent with the one generated in the Agora Console.
connectionChangedInvalidChannelName
7: Invalid channel name. Rejoin the channel with a valid channel name. A valid channel name is a string of up to 64 bytes in length. Supported characters (89 characters in total):
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
connectionChangedInvalidToken
8: Invalid token. Possible reasons are as follows:
  • The App Certificate for the project is enabled in Agora Console, but you do not pass in a token when joining a channel.
  • The uid specified when calling joinChannel to join the channel is inconsistent with the uid passed in when generating the token.
  • The generated token and the token used to join the channel are not consistent.
Ensure the following:
  • When your project enables App Certificate, you need to pass in a token to join a channel.
  • The user ID specified when generating the token is consistent with the user ID used when joining the channel.
  • The generated token is the same as the token passed in to join the channel.
connectionChangedTokenExpired
(9): The token currently being used has expired. You need to generate a new token on your server and rejoin the channel with the new token.
connectionChangedRejectedByServer
10: The connection is rejected by server. Possible reasons are as follows:
  • The user is already in the channel and still calls a method, for example, joinChannel, to join the channel. Stop calling this method to clear this error.
  • The user tries to join a channel while a test call is in progress. The user needs to join the channel after the call test ends.
connectionChangedSettingProxyServer
11: The connection state changed to reconnecting because the SDK has set a proxy server.
connectionChangedRenewToken
12: The connection state changed because the token is renewed.
connectionChangedClientIpAddressChanged
(13): Client IP address changed. If you receive this code multiple times, You need to prompt the user to switch networks and try joining the channel again.
connectionChangedKeepAliveTimeout
14: Timeout for the keep-alive of the connection between the SDK and the Agora edge server. The SDK tries to reconnect to the server automatically.
connectionChangedRejoinSuccess
15: The user has rejoined the channel successfully.
connectionChangedLost
16: The connection between the SDK and the server is lost.
connectionChangedEchoTest
17: The connection state changes due to the echo test.
connectionChangedClientIpAddressChangedByUser
18: The local IP address was changed by the user.
connectionChangedSameUidLogin
19: The user joined the same channel from different devices with the same UID.
connectionChangedTooManyBroadcasters
20: The number of hosts in the channel has reached the upper limit.