On Sun, Nov 13, 2011 at 11:18 AM, MinRK <[email protected]> wrote:
> > > On Sun, Nov 13, 2011 at 09:13, Thomas S Hatch <[email protected]> wrote: > >> >> >> On Sat, Nov 12, 2011 at 11:37 PM, Thomas S Hatch <[email protected]>wrote: >> >>> I am seeing something interesting that I suspect is a pyzmq issue. I >>> have some code that connects to a REP server and shoots off a REQ, >>> then receives. I am changing the code to not hang if the REP server is not >>> responding but it hangs when the python function returns. Any ideas what >>> could be causing this? >>> >>> Here is the code (same issue with a poller): >>> http://pastebin.com/XGzLxM0j >>> >>> >>> Any ideas? >>> >> > As with almost all hangs in zeromq, the answer is likely LINGER. If you > send a request with REQ, and LINGER is left as the default (wait forever), > then > socket.close will never return until the REP socket starts up, and > receives the message. You must set LINGER to something >= 0 in order for > close/term > to allow the message to be discarded. > > Can I ask why you have a `while True: ...time.sleep` instead of just using > a Poller? > > An example using LINGER and a Poller: http://pastebin.com/S74s722d > > Thanks, I was just missing the Linger setting, thanks for your time, it works like a charm now!
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
