This commit is contained in:
2021-03-23 10:51:44 +08:00
parent d5c83bb633
commit 362d8ba2dc
2 changed files with 11 additions and 14 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ class Server extends HttpService
return null; return null;
} }
} }
return $this->baseServer; return $this->startRpcService();
} }
@@ -353,7 +353,7 @@ class Server extends HttpService
} }
$this->onListenerBind($config, $this->baseServer); $this->onListenerBind($config, $this->baseServer);
return $this->startRpcService(); return $this->baseServer;
} }
+9 -12
View File
@@ -32,18 +32,15 @@ class Service extends Component
} }
foreach ($services as $service) { foreach ($services as $service) {
$mode = $service['mode'] ?? SWOOLE_SOCK_TCP6; $mode = $service['mode'] ?? SWOOLE_SOCK_TCP6;
$rpcServer = $server->addlistener($service['host'], $service['port'], $mode);
var_dump($service,$mode); $rpcServer->set([
// 'open_tcp_keepalive' => true,
// $rpcServer = $server->addlistener($service['host'], $service['port'], $mode); 'tcp_keepidle' => 30,
// $rpcServer->set([ 'tcp_keepinterval' => 10,
// 'open_tcp_keepalive' => true, 'tcp_keepcount' => 10,
// 'tcp_keepidle' => 30, 'open_http_protocol' => false,
// 'tcp_keepinterval' => 10, 'open_websocket_protocol' => false,
// 'tcp_keepcount' => 10, ]);
// 'open_http_protocol' => false,
// 'open_websocket_protocol' => false,
// ]);
} }
} }