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