The zmq_socket man page says, ZMQ_PAIR sockets are designed for inter-thread communication across the zmq_inproc(7) transport and do not implement functionality such as auto-reconnection. ZMQ_PAIR sockets are considered experimental and may have other missing or broken aspects.
Though it's documented, it really is a broken implementation. -Pieter On Mon, Jul 8, 2013 at 11:27 AM, Sergey Gavruk <[email protected]> wrote: > Hi, Pieter. > > Thanks for your answer, I am just leaning zmq and trying different patterns. > > I'm reading your book and later after my question I found that: > > "Principally, nodes come and go whereas threads are usually static. PAIR > sockets do not automatically reconnect if the remote node goes away and > comes back." (http://zguide.zeromq.org/page:all#Node-Coordination) > > It is a documented feature. And for thread sync that works okay. But I > haven't found this info anywhere except your book. > > > On Mon, Jul 8, 2013 at 11:52 AM, Pieter Hintjens <[email protected]> wrote: >> >> Hi Sergey, >> >> This is a fault in the implementation of PAIR sockets, something I >> wanted to fix at some stage. As a workaround you can replace PAIR with >> DEALER and it will work as intended. >> >> -Pieter >> >> On Sun, Jul 7, 2013 at 4:38 PM, Sergey Gavruk <[email protected]> wrote: >> > Hello. >> > >> > If I disconnect my client in zmq (pub/sub, req/rep) and then connect >> > again, >> > it will continue to receive messages. But with PAIR pattern i faced a >> > problem: >> > I am using this example >> > >> > https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/patterns/pair.html >> > and I found that if I have both client and server running, then I >> > stop-start >> > server, 2 sockets will continue send and receive messages. But if I >> > stop-start client - nothing will be printed to the terminal. Messages >> > will >> > not be sent and received. >> > >> > Here is my code: >> > server.py >> > http://pastebin.com/3bU93vSc >> > client.py >> > http://pastebin.com/2zdGXPCG >> > >> > So, I wonder: this is a bug or I am doing this wrong? >> > pyzmq==13.1.0 >> > zeromq==3.2.3 >> > >> > Thanks. >> > -- >> > Best regards, >> > Sergey Gavruk >> > >> > _______________________________________________ >> > zeromq-dev mailing list >> > [email protected] >> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev >> > >> _______________________________________________ >> zeromq-dev mailing list >> [email protected] >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > > -- > Best regards, > Sergey Gavruk > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
