lithium\net\socket\Context::write()

public method

Writes to the socket.

Parameters

  • string $data

    Data to write.

Returns

boolean

Success

Source

	public function write($data = null) {
		if (!is_resource($this->_resource)) {
			return false;
		}
		if (!is_object($data)) {
			$data = Libraries::instance(
				null, 'request', (array) $data + $this->_config, $this->_classes
			);
		}
		return stream_context_set_option(
			$this->_resource, $data->to('context', ['timeout' => $this->_timeout])
		);
	}