From 762c0b650d22428efcfaecfeff1a996ea333a406 Mon Sep 17 00:00:00 2001 From: "Roland Franssen :)" Date: Mon, 11 Mar 2024 09:36:30 +0100 Subject: [PATCH] skip ping on message fetch --- src/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index b8e8696..f33060d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -239,7 +239,7 @@ public function process(null|int|float $timeout = 0, bool $reply = true, bool $c try { $line = $this->readLine(1024, "\r\n", $checkTimeout); - if ($line && ($this->ping || trim($line) != 'PONG')) { + if ($line && ($this->ping || trim($line) != 'PONG') && ($this->pong || trim($line) != 'PING')) { break; } if ($line === false && $ping < time()) { @@ -247,7 +247,7 @@ public function process(null|int|float $timeout = 0, bool $reply = true, bool $c $this->send(new Ping([])); $line = $this->readLine(1024, "\r\n"); $ping = time() + $this->configuration->pingInterval; - if ($line && ($this->ping || trim($line) != 'PONG')) { + if ($line && ($this->ping || trim($line) != 'PONG') && ($this->pong || trim($line) != 'PING')) { break; } } catch (Throwable $e) {