diff --git a/src/ZM/Event/Swoole/WSCloseEvent.php b/src/ZM/Event/Swoole/WSCloseEvent.php index 6c94ff06..2e1a6be1 100644 --- a/src/ZM/Event/Swoole/WSCloseEvent.php +++ b/src/ZM/Event/Swoole/WSCloseEvent.php @@ -32,7 +32,6 @@ class WSCloseEvent implements SwooleEvent */ public function onActivate() { ZMUtil::checkWait(); - ConnectionManager::close($this->fd); set_coroutine_params(["server" => $this->server, "fd" => $this->fd]); foreach(ZMBuf::$events[SwooleEventAt::class] ?? [] as $v) { if(strtolower($v->type) == "close" && $this->parseSwooleRule($v)) { @@ -41,6 +40,7 @@ class WSCloseEvent implements SwooleEvent if(context()->getCache("block_continue") === true) break; } } + ConnectionManager::close($this->fd); return $this; }