变更
This commit is contained in:
@@ -5,7 +5,6 @@ namespace Kiri\Server\Abstracts;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Kiri;
|
use Kiri;
|
||||||
use Kiri\Abstracts\Config;
|
use Kiri\Abstracts\Config;
|
||||||
use Kiri\Core\Json;
|
|
||||||
use Kiri\Di\ContainerInterface;
|
use Kiri\Di\ContainerInterface;
|
||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
use Kiri\Server\Events\OnShutdown;
|
use Kiri\Server\Events\OnShutdown;
|
||||||
@@ -118,7 +117,7 @@ class AsyncServer implements ServerInterface
|
|||||||
if (is_null($match)) {
|
if (is_null($match)) {
|
||||||
throw new NotFindClassException('Unknown server type ' . $config->type);
|
throw new NotFindClassException('Unknown server type ' . $config->type);
|
||||||
}
|
}
|
||||||
$this->server = new $match($config->host, $config->port, SWOOLE_PROCESS, $config->mode);
|
$this->server = new $match($config->host, $config->port, $config->mode, $config->socket);
|
||||||
|
|
||||||
$this->server->set($this->systemConfig($config, $daemon));
|
$this->server->set($this->systemConfig($config, $daemon));
|
||||||
|
|
||||||
|
|||||||
+20
-1
@@ -21,7 +21,10 @@ class Config
|
|||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
||||||
|
|
||||||
public int $mode = SWOOLE_SOCK_TCP;
|
|
||||||
|
public int $mode = SWOOLE_PROCESS;
|
||||||
|
|
||||||
|
public int $socket = SWOOLE_SOCK_TCP;
|
||||||
|
|
||||||
|
|
||||||
public array $settings = [];
|
public array $settings = [];
|
||||||
@@ -141,4 +144,20 @@ class Config
|
|||||||
$this->events = $events;
|
$this->events = $events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getSocket(): int
|
||||||
|
{
|
||||||
|
return $this->socket;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $socket
|
||||||
|
*/
|
||||||
|
public function setSocket(int $socket): void
|
||||||
|
{
|
||||||
|
$this->socket = $socket;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user