diff --git a/HttpServer/Events/OnConnect.php b/HttpServer/Events/OnConnect.php index f92900bb..728f52f5 100644 --- a/HttpServer/Events/OnConnect.php +++ b/HttpServer/Events/OnConnect.php @@ -26,11 +26,13 @@ class OnConnect extends Callback public function onHandler(Server $server, int $fd, int $reactorId) { try { - defer(fn() => fire(Event::SYSTEM_RESOURCE_RELEASES)); - + defer(fn() => fire(Event::SYSTEM_RESOURCE_RELEASES)); if (($clientInfo = $server->getClientInfo($fd, $reactorId)) === false) { return; } + if (isset($clientInfo['websocket_status'])) { + return; + } fire($this->getName($clientInfo), [$server, $fd, $reactorId]); } catch (\Throwable $throwable) { $this->addError($throwable, 'connect'); diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 03caea27..773bff76 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -239,7 +239,7 @@ class Connection extends Pool * @param bool $isMaster * @throws Exception */ - public function disconnect($coroutineName, $isMaster = false) + public function disconnect($coroutineName, bool $isMaster = false) { $coroutineName = $this->name($coroutineName, $isMaster); $this->clean($coroutineName);