mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-27 02:25:34 +08:00
close ws connection after calling event
This commit is contained in:
@@ -32,7 +32,6 @@ class WSCloseEvent implements SwooleEvent
|
|||||||
*/
|
*/
|
||||||
public function onActivate() {
|
public function onActivate() {
|
||||||
ZMUtil::checkWait();
|
ZMUtil::checkWait();
|
||||||
ConnectionManager::close($this->fd);
|
|
||||||
set_coroutine_params(["server" => $this->server, "fd" => $this->fd]);
|
set_coroutine_params(["server" => $this->server, "fd" => $this->fd]);
|
||||||
foreach(ZMBuf::$events[SwooleEventAt::class] ?? [] as $v) {
|
foreach(ZMBuf::$events[SwooleEventAt::class] ?? [] as $v) {
|
||||||
if(strtolower($v->type) == "close" && $this->parseSwooleRule($v)) {
|
if(strtolower($v->type) == "close" && $this->parseSwooleRule($v)) {
|
||||||
@@ -41,6 +40,7 @@ class WSCloseEvent implements SwooleEvent
|
|||||||
if(context()->getCache("block_continue") === true) break;
|
if(context()->getCache("block_continue") === true) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ConnectionManager::close($this->fd);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user