We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This was a recurring problem when publishing to mosquitto.
Probably the socket closes during the read function and the fread no longer blocks the loop or something.
while (!feof($this->socket) && $togo > 0) { $fread = fread($this->socket, $togo); $string .= $fread; $togo = $int - strlen($string); }
You need something like this:
$loops = 20; while (!feof($this->socket) && $togo > 0) { usleep(500); $fread = fread($this->socket, $togo); $loops--; if(!$loops){return $string;} $string .= $fread; $togo = $int - strlen($string); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This was a recurring problem when publishing to mosquitto.
Probably the socket closes during the read function and the fread no longer blocks the loop or something.
You need something like this:
The text was updated successfully, but these errors were encountered: