From 34322875545014d8319103560dc7c9423a79f2e0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 10 Nov 2018 03:11:35 +0900 Subject: [PATCH] $mode, $sockType parameter --- bootstrap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 6a1ab99..d862d0d 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -8,11 +8,11 @@ use Swoole\Http\Response; use Swoole\Http\Server; -return function (string $context, string $name, string $ip, string $port) : int { +return function (string $context, string $name, string $ip, int $port, int $mode = SWOOLE_BASE, int $sockType = SWOOLE_SOCK_TCP) : int { if (! class_exists('swoole_http_server')) { throw new \RuntimeException('Swoole is not installed. See https://github.com/swoole/swoole-src/wiki/Installing'); } - $http = new Server($ip, $port); + $http = new Server($ip, $port, $mode, $sockType); $http->on('start', function () use ($ip, $port) { echo "Swoole http server is started at http://{$ip}:{$port}" . PHP_EOL; });