From 36bf25c6a8a55dd74a24de9239d18648b2bd84dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 31 Mar 2021 16:02:08 +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/Client/Http2.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HttpServer/Client/Http2.php b/HttpServer/Client/Http2.php index 6f5828e0..4cfeb398 100644 --- a/HttpServer/Client/Http2.php +++ b/HttpServer/Client/Http2.php @@ -229,7 +229,10 @@ class Http2 extends Component ]); return $client; }); - if (!$client->connected && !$client->connect()) { + if ($client->connected && $client->ping()) { + return $client; + } + if (!$client->connect()) { throw new Exception($client->errMsg, $client->errCode); } return $client;