modify plugin name

This commit is contained in:
2022-02-14 18:39:54 +08:00
parent 4cd5d0fbf1
commit 209cc8b507
+9 -7
View File
@@ -247,13 +247,15 @@ class ServerManager extends Component
*/ */
private function createBaseServer(string $type, string $host, int $port, int $mode, array $settings = []) private function createBaseServer(string $type, string $host, int $port, int $mode, array $settings = [])
{ {
$match = match ($type) { $this->server = new Server('0.0.0.0',0,SWOOLE_PROCESS,SOCK_STREAM);
Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
Constant::SERVER_TYPE_UDP => Server::class, // $match = match ($type) {
Constant::SERVER_TYPE_HTTP => HServer::class, // Constant::SERVER_TYPE_BASE, Constant::SERVER_TYPE_TCP,
Constant::SERVER_TYPE_WEBSOCKET => WServer::class // Constant::SERVER_TYPE_UDP => Server::class,
}; // Constant::SERVER_TYPE_HTTP => HServer::class,
$this->server = new $match($host, $port, SWOOLE_PROCESS, $mode); // 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'])); $this->server->set(array_merge(Config::get('server.settings', []), $settings['settings']));
$this->getContainer()->setBindings(SwooleServerInterface::class, $this->server); $this->getContainer()->setBindings(SwooleServerInterface::class, $this->server);