[zeromq-dev] Beginner question: What should I do given there's no "timeout" on recv?

Martin Sustrik sustrik at 250bpm.com
Sat Aug 28 14:52:09 CEST 2010


On 08/28/2010 02:41 PM, Naveen Chawla wrote:
> In REQ/REP, if there's no server, the calling application blocks forever, right?
>
> It's unacceptable of course, so briefly what are the ways around this?
> (e.g. I could have a dummy server always available and running that
> gives a guaranteed but delayed response to the request?)
>
> What's the best way? (I want either a reply or knowledge of "no
> server" before my client does anything more).

Use zmq_poll to poll for the reply. There's a timout argument there.

Martin



More information about the zeromq-dev mailing list