From 362d8ba2dc6e4270e43d64e97131ae4da7f5f1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 10:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Server.php | 4 ++-- Rpc/Service.php | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/HttpServer/Server.php b/HttpServer/Server.php index f31dc019..e0a58de1 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -129,7 +129,7 @@ class Server extends HttpService return null; } } - return $this->baseServer; + return $this->startRpcService(); } @@ -353,7 +353,7 @@ class Server extends HttpService } $this->onListenerBind($config, $this->baseServer); - return $this->startRpcService(); + return $this->baseServer; } diff --git a/Rpc/Service.php b/Rpc/Service.php index e7618fc1..25fa3952 100644 --- a/Rpc/Service.php +++ b/Rpc/Service.php @@ -32,18 +32,15 @@ class Service extends Component } foreach ($services as $service) { $mode = $service['mode'] ?? SWOOLE_SOCK_TCP6; - - var_dump($service,$mode); -// -// $rpcServer = $server->addlistener($service['host'], $service['port'], $mode); -// $rpcServer->set([ -// 'open_tcp_keepalive' => true, -// 'tcp_keepidle' => 30, -// 'tcp_keepinterval' => 10, -// 'tcp_keepcount' => 10, -// 'open_http_protocol' => false, -// 'open_websocket_protocol' => false, -// ]); + $rpcServer = $server->addlistener($service['host'], $service['port'], $mode); + $rpcServer->set([ + 'open_tcp_keepalive' => true, + 'tcp_keepidle' => 30, + 'tcp_keepinterval' => 10, + 'tcp_keepcount' => 10, + 'open_http_protocol' => false, + 'open_websocket_protocol' => false, + ]); } }