[zeromq-dev] Server freezes when there's no response

Martin Sustrik sustrik at 250bpm.com
Wed Nov 2 08:34:02 CET 2011


On 11/02/2011 03:23 AM, lanre lawal wrote:
> I noticed every time I load a page that's making a request to an
> address, the server seems to freeze whenever there is no response/data
> from the address. Is this a bug or am I doing something wrong here?
> here's my code:
>
> |     ZMQ.Context context = new ZMQ.Context(1);
>      ZMQ.Socket socket = context.Socket(ZMQ.SocketType.DEALER);
>      socket.Connect("address_goes_here");
>      socket.Recv();

If there's no message to receive, recv() call blocks and waits for a 
message. If you want a nanblocking recv() use ZMQ_NOBLOCK flag.

Martin




More information about the zeromq-dev mailing list