public function __construct($endpoint = null, $version = null, $context = null) { $this->_endpoint = $endpoint; $this->_version = $version; $this->context = $context ?: Context::get_instance(); $this->socket = new \ZMQSocket($this->context, ZMQ::SOCKET_XREQ); $this->socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 10); $this->connect($endpoint, $version); Channel::registerSocket($this->socket); }