Revert "改名"
This reverts commit fdf58326
This commit is contained in:
+14
-12
@@ -279,18 +279,9 @@ class ServerManager extends Component
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws Exception
|
||||
*/
|
||||
private function createBaseServer(string $type, string $host, int $port, int $mode, array $settings = [])
|
||||
{
|
||||
$match = match ($type) {
|
||||
Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
|
||||
Constant::SERVER_TYPE_UDP => Server::class,
|
||||
Constant::SERVER_TYPE_HTTP => HServer::class,
|
||||
Constant::SERVER_TYPE_WEBSOCKET => WServer::class
|
||||
};
|
||||
$this->server = new $match($host, $port, SWOOLE_PROCESS, $mode);
|
||||
$this->server->set(array_merge(Config::get('server.settings', []), $settings['settings']));
|
||||
|
||||
*
|
||||
*
|
||||
*
|
||||
$data = new Table($this->container->get(OutputInterface::class));
|
||||
$data->setHeaders(['key', 'value']);
|
||||
|
||||
@@ -305,6 +296,17 @@ class ServerManager extends Component
|
||||
$data->setStyle('box-double');
|
||||
$data->setRows($array);
|
||||
$data->render();
|
||||
*/
|
||||
private function createBaseServer(string $type, string $host, int $port, int $mode, array $settings = [])
|
||||
{
|
||||
$match = match ($type) {
|
||||
Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
|
||||
Constant::SERVER_TYPE_UDP => Server::class,
|
||||
Constant::SERVER_TYPE_HTTP => HServer::class,
|
||||
Constant::SERVER_TYPE_WEBSOCKET => WServer::class
|
||||
};
|
||||
$this->server = new $match($host, $port, SWOOLE_PROCESS, $mode);
|
||||
$this->server->set(array_merge(Config::get('server.settings', []), $settings['settings']));
|
||||
|
||||
$id = Config::get('id', 'system-service');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user