Skip to content

Commit

Permalink
skip ping on message fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0NL authored Mar 11, 2024
1 parent cb86625 commit 762c0b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ 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()) {
try {
$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) {
Expand Down

0 comments on commit 762c0b6

Please sign in to comment.