diff --git a/src/session_base.cpp b/src/session_base.cpp index c63185ed..e8cd6e45 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -587,7 +587,7 @@ void zmq::session_base_t::reconnect () reset (); // Reconnect. - if (options.reconnect_ivl != -1) + if (options.reconnect_ivl > 0) start_connecting (true); else { std::string *ep = new (std::string); diff --git a/src/stream_connecter_base.cpp b/src/stream_connecter_base.cpp index 16c58f66..138d7d61 100755 --- a/src/stream_connecter_base.cpp +++ b/src/stream_connecter_base.cpp @@ -101,7 +101,7 @@ void zmq::stream_connecter_base_t::process_term (int linger_) void zmq::stream_connecter_base_t::add_reconnect_timer () { - if (options.reconnect_ivl != -1) { + if (options.reconnect_ivl > 0) { const int interval = get_new_reconnect_ivl (); add_timer (interval, reconnect_timer_id); _socket->event_connect_retried ( diff --git a/src/vmci_connecter.cpp b/src/vmci_connecter.cpp index b53090ff..5768c78e 100644 --- a/src/vmci_connecter.cpp +++ b/src/vmci_connecter.cpp @@ -179,7 +179,7 @@ void zmq::vmci_connecter_t::start_connecting () void zmq::vmci_connecter_t::add_reconnect_timer () { - if (options.reconnect_ivl != -1) { + if (options.reconnect_ivl > 0) { int rc_ivl = get_new_reconnect_ivl (); add_timer (rc_ivl, reconnect_timer_id); socket->event_connect_retried (