From a7b2fea85a712785ab6d50a997a92bd1da113bc4 Mon Sep 17 00:00:00 2001 From: Savio Resende Date: Thu, 28 Dec 2023 14:59:28 -0600 Subject: [PATCH] Test timeout enhancement.6 --- src/Client.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index ee6cd1a..836f0cf 100644 --- a/src/Client.php +++ b/src/Client.php @@ -116,7 +116,9 @@ public function connect(): void go(fn () => $this->startConnection()); go(fn () => Timer::tick(5000, function (int $timerId) { $this->pingTimer = $timerId; - $this->getClient()->ping(); + if ($this->client->isConnected()) { + $this->getClient()->ping(); + } })); }); }