From b7469b9dd4f475df1105d54cc31108bbac28d01e Mon Sep 17 00:00:00 2001 From: sunxyw <31698606+sunxyw@users.noreply.github.com> Date: Sat, 21 May 2022 17:40:43 +0800 Subject: [PATCH] tmp fix close connection binding warning (#128) --- src/ZM/Event/SwooleEvent/OnClose.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ZM/Event/SwooleEvent/OnClose.php b/src/ZM/Event/SwooleEvent/OnClose.php index 60ee2c10..4b92f9c6 100644 --- a/src/ZM/Event/SwooleEvent/OnClose.php +++ b/src/ZM/Event/SwooleEvent/OnClose.php @@ -11,6 +11,7 @@ use ZM\Annotation\Swoole\OnCloseEvent; use ZM\Annotation\Swoole\OnSwooleEvent; use ZM\Annotation\Swoole\SwooleHandler; use ZM\Config\ZMConfig; +use ZM\ConnectionManager\ConnectionObject; use ZM\ConnectionManager\ManagerGM; use ZM\Console\Console; use ZM\Context\Context; @@ -34,6 +35,8 @@ class OnClose implements SwooleEvent } set_coroutine_params(['server' => $server, 'connection' => $conn, 'fd' => $fd]); + container()->instance(ConnectionObject::class, $conn); + $dispatcher1 = new EventDispatcher(OnCloseEvent::class); $dispatcher1->setRuleFunction(function ($v) { return $v->connect_type == ctx()->getConnection()->getName() && eval('return ' . $v->getRule() . ';');