[zeromq-dev] ZMQ reconnection

Pieter Hintjens ph at imatix.com
Thu Mar 15 16:42:44 CET 2012


On Thu, Mar 15, 2012 at 4:46 AM, Emmanuel TAUREL <taurel at esrf.fr> wrote:

> 1 - Add a new socket option like ZMQ_DISABLE_RECONNECT
> Cons: There are already quite a few socket options. I am not sure adding
> a new one is the best solution
>
> 2 - Use the value 0 for the already existing ZMQ_RECONNECT_IVL
> Cons: Could break some compatibility for those already using the value 0
> to get ultra fast reconnection.
> Pro: Simple

Simpler is better. However zero was a valid value according to the man
page and we have a policy about not breaking the API:
http://www.zeromq.org/docs:policies#toc2.

So my suggestion is to use ZMQ_RECONNECT_IVL and use -1 to mean "do
not reconnect".

-Pieter



More information about the zeromq-dev mailing list