[zeromq-dev] Multiple connects with a ZMQ_REQ socket appears not to work

Luca Boccassi luca.boccassi at gmail.com
Fri Feb 23 23:33:48 CET 2018

On Fri, 2018-02-23 at 19:18 +0000, Mark wrote:
> On 23Feb18, Luca Boccassi allegedly wrote:
> > That's because it's round-robin, and the connection is async - so
> > it
> > will wait on the first server to respond, and it never does so it's
> > blocked there. Sounds like what you really want is "fail-over" - IE
> > if
> > the first does not respond, try the second. That might work if you
> > tune
> > the tcp reconnect options to have a small timeout, so that the pipe
> > is
> > removed - by default it's quite large. Note sure it will work - try
> > it.
> The TCP (re)connection is being established just fine so I doubt
> re-connect options will help. (But on your suggestion I did try
> adjusting re-connect opts just to be sure - no effect).
> What did help somewhat was setting ZMQ_IMMEDIATE.
> But that doesn't handle the corner case of the connection appearing
> to
> be up as far as 0MQ is concerned, but unbeknown to it, the TCP socket
> is dead or will be dead when it tries to use it next.

That's what I mean - there are socket options for keepalive and
reconnect timeouts (which also mean connect timeouts) - if you tweak
those, the first connection pipe might get discarded after the timeout
- needs testing though

Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20180223/43c15446/attachment.sig>

More information about the zeromq-dev mailing list