diff --git a/src/Tcp/TcpServer.php b/src/Tcp/TcpServer.php index 51fef59a..5a29ec85 100644 --- a/src/Tcp/TcpServer.php +++ b/src/Tcp/TcpServer.php @@ -132,7 +132,7 @@ public function start() $this->tcpServer->on('connect', function (\Swoole\Server $server, $fd) { try { (new EventApp())->registerApp(function () use ($server, $fd) { - static::onConnect($server, $fd); + $this->onConnect($server, $fd); }); } catch (\Throwable $e) { self::catchException($e); @@ -201,7 +201,7 @@ public function start() foreach ($contextData as $key=>$value) { \Swoolefy\Core\Coroutine\Context::set($key, $value); } - static::onFinish($server, $task_id, $data); + $this->onFinish($server, $task_id, $data); }); return true; } catch (\Throwable $e) { @@ -215,7 +215,7 @@ public function start() $this->tcpServer->on('pipeMessage', function (\Swoole\Server $server, $from_worker_id, $message) { try { (new EventApp())->registerApp(function () use ($server, $from_worker_id, $message) { - static::onPipeMessage($server, $from_worker_id, $message); + $this->onPipeMessage($server, $from_worker_id, $message); }); return true; } catch (\Throwable $e) { @@ -232,7 +232,7 @@ public function start() $this->Pack->destroy(); } (new EventApp())->registerApp(function () use ($server, $fd) { - static::onClose($server, $fd); + $this->onClose($server, $fd); }); } catch (\Throwable $e) { self::catchException($e);