[zeromq-dev] FW: zmq hangs

Chuck Remes cremes.devlist at mac.com
Wed Nov 2 17:47:19 CET 2011


On Nov 2, 2011, at 11:11 AM, Alexander Altshuler wrote:

> Hi
> 
> I have simple zmq 3.0.2 based server.
> I have an application which communicate to this server by zmq and quit.
> After the application exit server hangs deep inside zmq code.
> 
> Application is closed-source. I may provide only binary.
> But server is very simple. I can provide the source code.
> All work on Win32 platform.
> 
> I spent a day trying to reproduce this hang with similar open code, but
> without success.
> When I back-ported this code to zeromq 2.1 - it works fine.
> 
> Do I have any chance to get help here?

Read this section of the guide:  http://zguide.zeromq.org/page:all#-MQ

1. Make sure all sockets set ZM_LINGER to 0 or a positive integer.

2. When zmq_term() is called, any sockets blocking on a read or write will be interrupted and return -1. Check zmq_errno() to see if the value is EINTR. If so, close the socket with zmq_close().

zmq_term() will hang forever unless all sockets are closed, and sockets won't close unless LINGER is set to 0 or higher.

I hope that helps.

cr




More information about the zeromq-dev mailing list