Skip to content

Commit

Permalink
Merge pull request #108 from vonsofh/master
Browse files Browse the repository at this point in the history
FIX BUG WHEN ROUTER NOT AVAILABLE
  • Loading branch information
EvilFreelancer committed Dec 3, 2023
2 parents 1145661 + fbd5a61 commit f247a4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,14 @@ public function readRAW(array $options = [])
return $this->customOutput;
}

// Read answer from socket in loop
// Read answer from socket in loop, or until timeout reached
$startTime = time();
while (true) {
// Exit from loop if timeout reached
if (time() > $startTime + $this->config('socket_timeout')) {
throw new ClientException('Socket timeout reached');
}

$word = $this->connector->readWord();

//Limit response number to finish the read
Expand Down

0 comments on commit f247a4c

Please sign in to comment.