new EventTube(address, cb, timeout)
构建事件订阅对象实例
Parameters:
Name | Type | Description |
---|---|---|
address |
string | websocket服务地址 |
cb |
websocketCallback | 处理返回信息的回调函数 |
timeout |
number | 重连的时间间隔 |
Methods
close(reason)
主动关闭websocket连接
Parameters:
Name | Type | Description |
---|---|---|
reason |
String | 解释主动关闭连接的原因,不超过123字节 |