Skip to content

Commit

Permalink
$mode, $sockType parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Nov 9, 2018
1 parent 93e437e commit 3432287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 3432287

Please sign in to comment.