lithium\net\socket\Context::write()
Implements
lithium\net\Socket::write()
Writes to the socket.
Parameters
-
string
$data
Data to write.
Returns
booleanSuccess
Source
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 stream_context_set_option(
$this->_resource, $data->to('context', ['timeout' => $this->_timeout])
);
}