lithium\net\socket\Stream::write()
Implements
lithium\net\Socket::write()
writes data to the stream resource
Parameters
-
string
$data
The string to be written.
Returns
mixedFalse on error, number of bytes written otherwise.
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 fwrite($this->_resource, (string) $data, strlen((string) $data));
}