PHPDaemon\Network\IOStream::writeln PHP Method

writeln() public method

Send data and appending \n to connection. Note that it just writes to buffer flushed at every baseloop
public writeln ( string $data ) : boolean
$data string Data to send
return boolean Success
    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;
    }