From e26ae905b2c961c0fe9f55c2c8f69db3ea3fc59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 16:52:45 +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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Rpc/Client.php b/Rpc/Client.php index 9e24c41d..3475e2a0 100644 --- a/Rpc/Client.php +++ b/Rpc/Client.php @@ -57,6 +57,18 @@ class Client extends Component } + /** + * 断开链接 + */ + public function close() + { + if (!$this->client || !$this->client->isConnected()) { + return; + } + $this->client->close(); + } + + /** * @return mixed * @throws Exception