ConnectionStatus 枚举(Flutter IMLib)
连接状态枚举:共 4 个取值,定义来自 domain.json → enums.ConnectionStatus。
基本信息
| 项 | 值 |
|---|---|
| 枚举 | ConnectionStatus |
| 取值数 | 4 |
| 本平台常量名 | RongIMConnectionStatus |
| IDL 来源 | domain.json → enums.ConnectionStatus |
| 跨端一致性 | 取值跨端一致;常量名与成员名按平台绑定 |
| 平台状态 | 已交付 |
枚举常量摘要
| 名称 | 值 | 说明 |
|---|---|---|
CONNECTED | 0 | 已连接(收到 hello 之后) |
CONNECTING | 1 | 正在建连 / 重连 |
DISCONNECTED | 2 | 未连接(初始、主动断开、鉴权失败或放弃重连) |
SUSPEND | 3 | 连接中断,SDK 正在指数退避重连(异常断开) |
使用说明
getConnectionStatus() 的返回值;状态变化通过 CONNECTING / CONNECTED / DISCONNECT / SUSPEND / KICKED 事件通知。
示例
Dart
if (engine.getConnectionStatus() == RongIMConnectionStatus.CONNECTED) {
// 可以发送消息
}相关链接
- 使用该枚举的类:RCIMIWEngine、RongIMEvents
- 枚举索引:枚举;错误码:ErrorCode;事件:EventType
- 类列表:类;索引:索引