$registerAddress
$registerAddress : string|array
注册中心地址
数据发送相关
$registerAddress : string|array
注册中心地址
$secretKey : string
秘钥
$connectTimeout : int
链接超时时间
$persistentConnection : bool
与Gateway是否是长链接
$businessWorker : object
gateway 实例
sendToAll(string $message, array $client_id_array = null, array $exclude_client_id = null, bool $raw = false) : void
向所有客户端连接(或者 client_id_array 指定的客户端连接)广播消息
string | $message | 向客户端发送的消息 |
array | $client_id_array | 客户端 id 数组 |
array | $exclude_client_id | 不给这些client_id发 |
bool | $raw | 是否发送原始数据(即不调用gateway的协议的encode方法) |
sendToGroup(int|string|array $group, string $message, array $exclude_client_id = null, bool $raw = false) : void
向 group 发送
int|string|array | $group | 组(不允许是 0 '0' false null array()等为空的值) |
string | $message | 消息 |
array | $exclude_client_id | 不给这些client_id发 |
bool | $raw | 发送原始数据(即不调用gateway的协议的encode方法) |