This commit is contained in:
xl
2023-06-12 15:31:44 +08:00
parent 599e353a28
commit 8248b418ad
4 changed files with 15 additions and 19 deletions
+2 -3
View File
@@ -134,8 +134,7 @@ class AsyncServer implements ServerInterface
* @param $daemon
* @return void
* @throws ConfigException
* @throws ReflectionException
*/
*/
private function initServer($match, $config, $daemon): void
{
$this->server = new $match($config->host, $config->port, $config->mode, $config->socket);
@@ -145,7 +144,7 @@ class AsyncServer implements ServerInterface
if (!isset($config->events[Constant::SHUTDOWN])) {
$config->events[Constant::SHUTDOWN] = [OnServer::class, 'onShutdown'];
}
Kiri::service()->set('server', $this->server);
Kiri::getDi()->bind(ServerInterface::class, $this->server);
}