Write data to the connection

@param string $data
536
protected function write(string $data)
    {
        $this->clearTimeout();
        $this->conn->write($data . static::NEW_LINE);
        $this->log('<-' . $data);
        $this->setTimeout();
    }
716145
private function send(string $data):void
    {

        socket_write($this->socket, $data, strlen($data)) or $this->error();

    }
377178
protected function write($buffer)
    {
        $socket = $this->getResource();

        while (($length = strlen($buffer)) > 0) {
            $written = @fwrite($socket, $buffer);

            if ($length === $written) {
                return;
            }

            if ($written === false || $written === 0) {
                $this->onConnectionError('Error while writing bytes to the server.');
            }

            $buffer = substr($buffer, $written);
        }
    }
567535
public void writeData(String data) {
        _buffer.append("<![CDATA[");
        _buffer.append( data);
        _buffer.append( "]]>");
    }
590239
public function write(string $data): int
    {
        if (!$this->connected()) {
            throw new LogicException('Not connected');
        }

        return (int) fwrite($this->connection, $data, strlen($data));
    }
891756
public function write_setting($data) {
        if ($data === '') {
            $data = (int)$this->defaultsetting;
        } else {
            $data = $data;
        }
        return parent::write_setting($data);
    }
121746
public function write($key, $data)
    {
        apcu_store($this->_prefix . $key, $data, $this->_ttl);
    }
1117736
public function write($data)
    {
        if ($this->closed) {
            return;
        }

        $all = $this->tail . $data;
        $messages = $this->getParser()->consumeAll($all);
        $this->tail = $all;

        foreach ($messages as $message) {
            if (isset($message['message'])) {
                $this->emit('data', array($message['message']));
                $this->emit('irc.received', array($message));
            } elseif (isset($message['invalid'])) {
                $this->emit('invalid', array($message['invalid']));
            }
        }
    }
526480
public function write($data)
    {
        $dataLength     = strlen($data);
        $start          = substr($this->buffer, 0, $this->position);
        $end            = substr($this->buffer, $this->position + $dataLength);
        $this->buffer   = $start.$data.$end;
        $this->length   = strlen($this->buffer);
        $this->position += $dataLength;
        return $dataLength;
    }
160425
protected function _writeTimestamp($data)
    {
        $data = serialize($data);
        file_put_contents($this->path . static::BUILD_TIME_FILE, $data);
        chmod($this->path . static::BUILD_TIME_FILE, 0644);
    }
240145
public function write($data)
    {
        if ($this->_handle === null) {
            throw new PHPRtfLite_Exception('Can not write on an undefined handle! Forgot to call open()?');
        }
        fwrite($this->_handle, $data);
    }
763617
public static void write(final String data, final Writer output) throws IOException {
		if (data != null) {
			output.write(data);
		}
	}
783208
public function write($data = null) {
		if (!is_resource($this->_resource)) {
			return false;
		}
		if (!is_object($data)) {
			$data = $this->_instance($this->_classes['request'], (array) $data + $this->_config);
		}
		return fwrite($this->_resource, (string) $data, strlen((string) $data));
	}
9990
private function write( $data ) {

		if( !$this->connection->established ) {

			Log::info('LxMPD connection is NOT established', array($data));

                        $this->connection->establish();
                }

		if( !fputs( $this->connection->socket, "$data\n" ) ) {

			Log::info('LxMPD write fputs seems to have failed writing to socket', array($data));

			throw new MPDException( 'Failed to write to MPD socket', self::MPD_WRITE_FAILED );
                }

                return true;
        }
996761
protected function _send($data) {
		if (fwrite($this->_connection(), $data, strlen($data)) === false) {
			throw new NetworkException('Could not send registration to Growl Server.');
		}
		return true;
	}
1280314
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;
    }
1093954
public function writeAsync($data)
    {
        $this->dataBuffer .= $this->buffer->encodeMessage(serialize($data));
        if ($this->writeEvent === false)
        {
            $this->loop->addWriteStream($this->connection, function ($stream, LoopInterface $loop)
            {
                if (strlen($this->dataBuffer) > 0)
                {
                    $dataWritten = fwrite($stream,$this->dataBuffer);
                    $this->dataBuffer = substr($this->dataBuffer,$dataWritten);
                    if(strlen($this->dataBuffer) <= 0)
                    {
                        $loop->removeWriteStream($stream);
                        $this->writeEvent = false;
                    }
                }
            });
            $this->writeEvent = true;
        }
    }