public function router($dsn = null) { $socket = new SocketWithReqRep($this->context->getSocket(\ZMQ::SOCKET_ROUTER), $this->serializer, $this->loop); if ($dsn) { $socket->bind($dsn); } return $socket; }
public function __construct(\ZMQSocket $socket, Serializer $serializer, LoopInterface $loop) { parent::__construct($socket, $serializer, $loop); $fd = $this->socket->getSockOpt(\ZMQ::SOCKOPT_FD); $this->buffer = new Buffer($this->socket, $fd, $this->loop, [$this, 'handleEvents']); }