From 63be575f56634ae87a5fa10e96c200f7b72c1c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Sun, 1 Nov 2020 04:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Server.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index ef554156..1c784225 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -300,6 +300,9 @@ class Server extends Application if (!($this->baseServer instanceof \Swoole\Server)) { $this->parseServer($config, $settings); } else { + if ($this->isUse($config['port'])) { + return $this->error_stop($config['host'], $config['port']); + } $newListener = $this->baseServer->addlistener($config['host'], $config['port'], $config['mode']); if (isset($config['settings']) && is_array($config['settings'])) { $newListener->set($config['settings']); @@ -346,9 +349,6 @@ class Server extends Application */ private function onListenerBind($config, $newListener) { - if ($this->isUse($config['port'])) { - return $this->error_stop($config['host'], $config['port']); - } $this->debug(sprintf('Listener %s::%d', $config['host'], $config['port'])); if ($config['type'] == self::HTTP) { $this->onBind($newListener, 'request', [Snowflake::createObject(OnRequest::class), 'onHandler']);