From 17ea843ddf4d2bd4a5f245a409269b4a3ae85ee1 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Wed, 28 Jul 2021 01:49:52 +0800 Subject: [PATCH] modify --- Server/HTTPServerListener.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Server/HTTPServerListener.php b/Server/HTTPServerListener.php index f60db5e4..f0a588d5 100644 --- a/Server/HTTPServerListener.php +++ b/Server/HTTPServerListener.php @@ -68,15 +68,14 @@ class HTTPServerListener extends Abstracts\Server static::$_http->set($settings['settings'] ?? []); static::$_http->on('request', [$reflect, 'onRequest']); - static::$_http->on('connect', [$reflect, 'onConnect']); - if (swoole_version() >= '4.7.0') { - static::$_http->on('disconnect', [$reflect, 'onDisconnect']); - $reflect->setEvents(Constant::DISCONNECT, $settings['events'][Constant::DISCONNECT] ?? null); - } else { - static::$_http->on('close', [$reflect, 'onClose']); - $reflect->setEvents(Constant::CLOSE, $settings['events'][Constant::CLOSE] ?? null); - } - $reflect->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null); +// if (swoole_version() >= '4.7.0') { +// static::$_http->on('disconnect', [$reflect, 'onDisconnect']); +// $reflect->setEvents(Constant::DISCONNECT, $settings['events'][Constant::DISCONNECT] ?? null); +// } else { +// static::$_http->on('close', [$reflect, 'onClose']); +// $reflect->setEvents(Constant::CLOSE, $settings['events'][Constant::CLOSE] ?? null); +// } +// $reflect->setEvents(Constant::CONNECT, $settings['events'][Constant::CONNECT] ?? null); return static::$_http; }