[zeromq-dev] ZMQ REQ client with multiple socket servers blocked when one server is down?

Eric Gendron conceptid at gmail.com
Sat Dec 31 14:40:00 CET 2016


zmq_setsockopt - set ØMQ socket options

There is an option for timeout...
If not set it will wait infinite by default.

Maybe it will help you.


On Dec 31, 2016 8:29 AM, "D.A. Vaughn" <dvaughn88 at mail.com> wrote:

> In the example below taken from Nicholas Piel's ZMQ tutorial, a client
> makes connections to socket 5000 and 6000. My question is, suppose there
> are two separate servers, one that handles port 5000 messages and one that
> handles 6000?
>
> What happens if the server listening to port 5000 is down? It appears to
> me this client below is blocked even though one of its servers is available.
>
> Regards
>
> David
>
> import zmq
> context = zmq.Context()
> socket = context.socket(zmq.REQ)
> socket.connect("tcp://127.0.0.1:5000")
> socket.connect("tcp://127.0.0.1:6000")
>
> for i in range(10):
>     msg = "msg %s" % i
>     socket.send(msg)
>     print "Sending", msg
>     msg_in = socket.recv()
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20161231/a7945bda/attachment.htm>


More information about the zeromq-dev mailing list