lithium\net\Socket::send()

public method

Aggregates read and write methods into a coherent request response

Parameters

  • \lithium\net\Message $message
  • array $options
    • 'response': a fully-namespaced string for the response object

Returns

object

a response object based on \lithium\net\Message

Source

	public function send($message = null, array $options = []) {
		$defaults = ['response' => $this->_classes['response']];
		$options += $defaults;

		if ($this->write($message)) {
			$config = ['message' => $this->read()] + $this->_config;
			return Libraries::instance(null, $options['response'], $config, $this->_classes);
		}
	}