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 */