跳到主要内容

set_callback

注册指定类型的回调函数

声明

void set_callback(string type, function callback)

参数

参数名描述
type允许三个取值:
type='event': 注册处理网络事件的回调函数
type='message': 注册处理网络数据的回调函数
type='pingpong': 注册ping/pong机制事件的回调函数
callback回调函数

返回值

使用方式

返回文档