Property | Type | Description | |
---|---|---|---|
$businessWorker | object | gateway实例 |
Method | Description | |
---|---|---|
closeClient ( integer $client_id ) | 关闭某个客户端 | |
getOnlineStatus ( ) : array | 获取在线状态,目前返回一个在线client_id数组 | |
isOnline ( integer $client_id ) : 0/1 | 判断某个客户端是否在线 | |
sendToAll ( string $message, array $client_id_array = null ) | 向所有客户端(或者client_id_array指定的客户端)广播消息 | |
sendToClient ( integer $client_id, string $message ) | 向某个客户端发消息 | |
setBusinessWorker ( $business_worker_instance ) | 设置gateway实例 | |
updateSocketSession ( integer $client_id, string $session_str ) | 更新session,框架自动调用,开发者不要调用 |
Method | Description | |
---|---|---|
kickAddress ( $address, integer $client_id ) | 踢掉某个网关的socket | |
sendCmdAndMessageToClient ( integer $client_id, integer $cmd, string $message ) : boolean | 想某个用户网关发送命令和消息 | |
sendToGateway ( string $address, $gateway_data ) | 发送数据到网关 | |
sendUdpAndRecv ( integer $address, $data ) : boolean | 发送udp数据并返回 |
public static closeClient ( integer $client_id ) | ||
$client_id | integer |
public static getOnlineStatus ( ) : array | ||
return | array |
protected static kickAddress ( $address, integer $client_id ) | ||
$client_id | integer |
public static sendToClient ( integer $client_id, string $message ) | ||
$client_id | integer | |
$message | string |
protected static sendToGateway ( string $address, $gateway_data ) | ||
$address | string |
protected static sendUdpAndRecv ( integer $address, $data ) : boolean | ||
$address | integer | |
return | boolean |
public static setBusinessWorker ( $business_worker_instance ) |
public static updateSocketSession ( integer $client_id, string $session_str ) | ||
$client_id | integer | |
$session_str | string |
protected static object $businessWorker | ||
return | object |