Gateway::closeClient

    全局唯一标识客户端连接的id

    1. use \GatewayWorker\Lib\Gateway;
    2. {
    3. ...
    4. public static function onMessage($client_id, $message)
    5. {
    6. // 如果传递的消息不ok就踢掉对应客户端
    7. if(!$is_ok)
    8. Gateway::closeClient($client_id);
    9. }
    10. }