From 5a6716ca3d984b500d64bdb82b4fd9974614740f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 15:26:22 +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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index d47c0e99..97eefce3 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -94,7 +94,7 @@ class Server extends Application $configs = Config::get('servers', true); foreach ($configs as $config) { if ($this->isUse($config['port'])) { - return $this->error('Port ' . $config['host'] . '::' . $config['port'] . ' is already.'); + return $this->error_stop($config['host'], $config['port']); } } $baseServer = $this->initCore($configs); @@ -102,6 +102,17 @@ class Server extends Application } + /** + * @param $host + * @param $Port + * @throws Exception + */ + public function error_stop($host, $Port) + { + $this->error(sprintf('Port %s::%d is already.', $host, $Port)); + } + + /** * @return bool */