bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
773 stars 460 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;
}