Exemplo n.º 1
0
 public function __construct($spID = null, $spVer = null, $sender = null, $linger = 100, $sndhwm = 1000, $rcvhwm = 1000)
 {
     if (self::$context === null) {
         self::$context = new ZMQContext(1, false);
         self::$poller = new ZMQPoll();
     }
     $socket = new ZMQSocket(self::$context, ZMQ::SOCKET_DEALER);
     $socket->setsockopt(ZMQ::SOCKOPT_LINGER, $linger);
     $socket->setsockopt(ZMQ::SOCKOPT_SNDHWM, $sndhwm);
     $socket->setsockopt(ZMQ::SOCKOPT_RCVHWM, $rcvhwm);
     self::$poller->add($socket, ZMQ::POLL_IN);
     $this->socket = $socket;
     $this->spID = $spID;
     $this->spVer = $spVer;
     $this->sender = $sender;
 }