This commit is contained in:
2020-09-02 11:41:05 +08:00
parent 8397c2ac8a
commit f7e036d2fa
+3 -2
View File
@@ -151,10 +151,11 @@ class Server extends Application
private function dispatchCreate($config, $settings)
{
if (!($this->baseServer instanceof \Swoole\Server)) {
$this->baseServer = new ($this->dispatch($config['type']))();
$class = $this->dispatch($config['type']);
$this->baseServer = new $class($config['host'], $config['port'], SWOOLE_PROCESS, $config['mode']);
$this->baseServer->set($settings);
} else {
$newListener = $this->baseServer->addlistener($config['host'], $config['port'], SWOOLE_TCP);
$newListener = $this->baseServer->addlistener($config['host'], $config['port'], $config['mode']);
if (!empty($settings)) {
$newListener->set($settings);
}