Gateway::closeClient 全局唯一标识客户端连接的id use \GatewayWorker\Lib\Gateway;{ ... public static function onMessage($client_id, $message) { // 如果传递的消息不ok就踢掉对应客户端 if(!$is_ok) Gateway::closeClient($client_id); } }