bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
765 stars 461 forks source link

Undefined variable '$fwrite' #134

Open horaciocastro7 opened 2 years ago

horaciocastro7 commented 2 years ago
protected function _fwrite($buffer)
{
    $buffer_length = strlen($buffer);
    for ($written = 0; $written < $buffer_length; $written += $fwrite) {
        $fwrite = fwrite($this->socket, substr($buffer, $written));
        if ($fwrite === false) {
            return false;
        }
    }
    return $buffer_length;
}