[zeromq-dev] The zmq_recv() call in the client hangs ..

김종환 jhkim at daumsoft.com
Thu Apr 28 11:43:49 CEST 2011


Hi,

 

I was testing a rather simple client-server application using 0MQ and
bumped into a problem which seemed to have a simple solution. The simplied
code for my program is as follows:

 

//////

/* server(multithread) */

 

// 1. Recv message

char *string = s_recv(receiver);

 

// 2. Do some work

// * Some work *

 

// 3. Send a reply back to client

s_send(receiver, buff);

 

//////

 

/* client */

 

// send message

zmq_send(requester, &request, 0);

 

// recv message

zmq_recv(requester, &reply, 0);

 

///////

 

When we execute the application, the zmq_recv() call in the client hangs
forever if the server goes down for some reason. Is there any way to detect
the status of the server to perform an appropriate action?

 

Regards,

 

Jonghwan

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110428/048b8f20/attachment.htm>


More information about the zeromq-dev mailing list