agora_rtm_handler_t结构体 参考

  • C

更新时间不可用

RTM 事件处理回调。

结构体成员变量说明

on_rtm_data

void(*) on_rtm_data(const char *rtm_uid, const void *msg, size_t msg_len, rtm_message_type_e msg_type, const char *custom_type)

RTM 消息回调。

参数
参数名描述
rtm_uid
[in]

发送消息的 RTM 用户 ID。

msg
[in]

收到的消息内容。

msg_len
[in]

消息长度。单位为字节。

msg_type
[in]

收到的 RTM 消息类型。详见 rtm_message_type_e 。

custom_type
[in]

自定义消息类型;未设置时为 NULL。

表格内容超出当前宽度,可横向滚动查看更多列。

on_rtm_event

void(* on_rtm_event)(const char *rtm_uid, rtm_event_type_e event_type, rtm_err_code_e err_code)

RTM 事件回调。

参数
参数名描述
rtm_uid
[in]

RTM 用户 ID。

event_type
[in]

事件类型。详见 rtm_event_type_e 。

err_code
[in]

错误码。详见 rtm_err_code_e 。

表格内容超出当前宽度,可横向滚动查看更多列。

on_rtm_send_data_result

void(* on_rtm_send_data_result)(const char *rtm_uid, uint32_t msg_id, rtm_msg_state_e state)

agora_rtm_send_data 方法调用结果回调。

参数
参数名描述
rtm_uid
[in]

RTM 用户 ID。

msg_id
[in]

消息 ID。

state
[in]

RTM 消息的发送状态。详见 rtm_msg_state_e 。

表格内容超出当前宽度,可横向滚动查看更多列。

on_rtm_publish_result

void(*) on_rtm_publish_result(const char *channel_name, uint32_t msg_id, rtm_msg_state_e state)

agora_rtm_publish 方法调用结果回调。

参数
参数名描述
channel_name
[in]

消息发布到的频道名称。

msg_id
[in]

由应用定义的消息 ID。

state
[in]

RTM 消息发送状态。详见 rtm_msg_state_e 。

表格内容超出当前宽度,可横向滚动查看更多列。

on_rtm_subscribe_data

void(*) on_rtm_subscribe_data(const char *channel_name, const char *rtm_uid, const void *msg, size_t msg_len, rtm_message_type_e msg_type, const char *custom_type)

收到已订阅 RTM 频道的消息时触发的回调。

参数
参数名描述
channel_name
[in]

收到消息的频道名称。

rtm_uid
[in]

消息发送者的 RTM 用户 ID。

msg
[in]

收到的消息数据。

msg_len
[in]

收到的消息数据长度,单位为字节。

msg_type
[in]

收到的消息类型。详见 rtm_message_type_e 。

custom_type
[in]

自定义消息类型;未设置时为 NULL。

表格内容超出当前宽度,可横向滚动查看更多列。

on_rtm_subscribe_result

void(*) on_rtm_subscribe_result(const char *channel_name, rtm_err_code_e err_code)

agora_rtm_subscribe 方法调用结果回调。

参数
参数名描述
channel_name
[in]

已订阅的频道名称。

err_code
[in]

订阅结果。详见 rtm_err_code_e 。

表格内容超出当前宽度,可横向滚动查看更多列。

该结构体的文档由以下文件生成:

  • agora_rtc_api.h