[zeromq-dev] poller lifecycle

Doherty, Kevin Kevin.Doherty at mlp.com
Mon Jul 30 12:43:59 CEST 2012


Folks,
             commenting out the line below results in the exception shown.
When creating a new socket after closing the old.
Unregistering the closed socket from the poller object and adding the new one to the same poller object does not seem to work.
The poll/send complains about an invaid argument ?
(Creating a new poller object is fine.)

                                    params.items.unregister(params.zmqPubSocket);
                                    params.zmqPubSocket.close();
                                    params.zmqPubSocket = ((ZMQ.Context)zmqContext).socket (ZMQ.PUSH);
                                    //**************** params.items = ((ZMQ.Context)zmqContext).poller();
                                    params.zmqPubSocket.setLinger(0);
                                    params.items.register(params.zmqPubSocket, ZMQ.Poller.POLLOUT);
                                    params.items.register(params.zmqPubSocket, ZMQ.Poller.POLLERR);
                                    params.zmqPubSocket.bind (params.sendTo);
                                    try{Thread.sleep(5000);}catch(Exception e){}
                                    params.items.poll(1000000);  <<<<<<<<<<<<<<<<<<<<<<<<<<<


zmq PUSH send failed 22
Connect: zmq throwing
org.zeromq.ZMQException: Invalid argument(0x16)
        at org.zeromq.ZMQ$Poller.run_poll(Native Method)
        at org.zeromq.ZMQ$Poller.poll(ZMQ.java:1298)


######################################################################
The information contained in this communication is confidential and
may contain information that is privileged or exempt from disclosure
under applicable law. If you are not a named addressee, please notify
the sender immediately and delete this email from your system.
If you have received this communication, and are not a named
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
######################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120730/f57cbdfe/attachment.htm>


More information about the zeromq-dev mailing list