public function write($data)
{
if (!$this->alive) {
Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
return false;
}
if (!isset($this->bevWrite)) {
return false;
}
if (!mb_orig_strlen($data)) {
return true;
}
$this->writing = true;
Daemon::$noError = true;
if (!$this->bevWrite->write($data) || !Daemon::$noError) {
$this->close();
return false;
}
return true;
}