mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 16:06:09 +00:00
Problem: connecter classes do not handle ZMQ_RECONNECT_IVL of -1 (#3163)
* Problem: connecter classes do not handle ZMQ_RECONNECT_IVL of -1 Solution: Add guards to prevent a reconnect timer from starting if ZMQ_RECONNECT_IVL is -1 (Issue 3158)
This commit is contained in:
parent
3a1e8f0704
commit
0867c38032
@ -176,10 +176,12 @@ void zmq::ipc_connecter_t::start_connecting ()
|
|||||||
|
|
||||||
void zmq::ipc_connecter_t::add_reconnect_timer ()
|
void zmq::ipc_connecter_t::add_reconnect_timer ()
|
||||||
{
|
{
|
||||||
int rc_ivl = get_new_reconnect_ivl ();
|
if (options.reconnect_ivl != -1) {
|
||||||
add_timer (rc_ivl, reconnect_timer_id);
|
int rc_ivl = get_new_reconnect_ivl ();
|
||||||
socket->event_connect_retried (endpoint, rc_ivl);
|
add_timer (rc_ivl, reconnect_timer_id);
|
||||||
timer_started = true;
|
socket->event_connect_retried (endpoint, rc_ivl);
|
||||||
|
timer_started = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::ipc_connecter_t::get_new_reconnect_ivl ()
|
int zmq::ipc_connecter_t::get_new_reconnect_ivl ()
|
||||||
|
@ -268,10 +268,12 @@ void zmq::socks_connecter_t::error ()
|
|||||||
|
|
||||||
void zmq::socks_connecter_t::start_timer ()
|
void zmq::socks_connecter_t::start_timer ()
|
||||||
{
|
{
|
||||||
const int interval = get_new_reconnect_ivl ();
|
if (options.reconnect_ivl != -1) {
|
||||||
add_timer (interval, reconnect_timer_id);
|
const int interval = get_new_reconnect_ivl ();
|
||||||
_status = waiting_for_reconnect_time;
|
add_timer (interval, reconnect_timer_id);
|
||||||
_socket->event_connect_retried (_endpoint, interval);
|
_status = waiting_for_reconnect_time;
|
||||||
|
_socket->event_connect_retried (_endpoint, interval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::socks_connecter_t::get_new_reconnect_ivl ()
|
int zmq::socks_connecter_t::get_new_reconnect_ivl ()
|
||||||
|
@ -226,10 +226,12 @@ void zmq::tcp_connecter_t::add_connect_timer ()
|
|||||||
|
|
||||||
void zmq::tcp_connecter_t::add_reconnect_timer ()
|
void zmq::tcp_connecter_t::add_reconnect_timer ()
|
||||||
{
|
{
|
||||||
const int interval = get_new_reconnect_ivl ();
|
if (options.reconnect_ivl != -1) {
|
||||||
add_timer (interval, reconnect_timer_id);
|
const int interval = get_new_reconnect_ivl ();
|
||||||
_socket->event_connect_retried (_endpoint, interval);
|
add_timer (interval, reconnect_timer_id);
|
||||||
_reconnect_timer_started = true;
|
_socket->event_connect_retried (_endpoint, interval);
|
||||||
|
_reconnect_timer_started = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::tcp_connecter_t::get_new_reconnect_ivl ()
|
int zmq::tcp_connecter_t::get_new_reconnect_ivl ()
|
||||||
|
@ -178,10 +178,12 @@ void zmq::tipc_connecter_t::start_connecting ()
|
|||||||
|
|
||||||
void zmq::tipc_connecter_t::add_reconnect_timer ()
|
void zmq::tipc_connecter_t::add_reconnect_timer ()
|
||||||
{
|
{
|
||||||
int rc_ivl = get_new_reconnect_ivl ();
|
if (options.reconnect_ivl != -1) {
|
||||||
add_timer (rc_ivl, reconnect_timer_id);
|
int rc_ivl = get_new_reconnect_ivl ();
|
||||||
socket->event_connect_retried (endpoint, rc_ivl);
|
add_timer (rc_ivl, reconnect_timer_id);
|
||||||
timer_started = true;
|
socket->event_connect_retried (endpoint, rc_ivl);
|
||||||
|
timer_started = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::tipc_connecter_t::get_new_reconnect_ivl ()
|
int zmq::tipc_connecter_t::get_new_reconnect_ivl ()
|
||||||
|
@ -178,10 +178,12 @@ void zmq::vmci_connecter_t::start_connecting ()
|
|||||||
|
|
||||||
void zmq::vmci_connecter_t::add_reconnect_timer ()
|
void zmq::vmci_connecter_t::add_reconnect_timer ()
|
||||||
{
|
{
|
||||||
int rc_ivl = get_new_reconnect_ivl ();
|
if (options.reconnect_ivl != -1) {
|
||||||
add_timer (rc_ivl, reconnect_timer_id);
|
int rc_ivl = get_new_reconnect_ivl ();
|
||||||
socket->event_connect_retried (endpoint, rc_ivl);
|
add_timer (rc_ivl, reconnect_timer_id);
|
||||||
timer_started = true;
|
socket->event_connect_retried (endpoint, rc_ivl);
|
||||||
|
timer_started = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmq::vmci_connecter_t::get_new_reconnect_ivl ()
|
int zmq::vmci_connecter_t::get_new_reconnect_ivl ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user