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