From f5d3cec79483b8574689ac400e8fc7b9e161c084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 16:48:10 +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 --- Rpc/Client.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rpc/Client.php b/Rpc/Client.php index f9774dd9..5c99033b 100644 --- a/Rpc/Client.php +++ b/Rpc/Client.php @@ -62,7 +62,7 @@ class Client extends Component public function getClient(): CClient { return objectPool(CClient::class, function () { - $client = new CClient(SWOOLE_SOCK_TCP6); + $client = new CClient($this->config['mode'] ?? SWOOLE_SOCK_TCP); $client->set([ 'timeout' => 0.5, 'connect_timeout' => 1.0, @@ -70,6 +70,7 @@ class Client extends Component 'read_timeout' => 0.5, 'open_tcp_keepalive' => true, ]); + return $client; }); }