mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-18 03:29:49 +02:00
Disable reconnection option
Add value -1 to the ZMQ_RECONNECT_IVL to disable the reconnection algorithm
This commit is contained in:
@@ -223,7 +223,7 @@ ZMQ_RECONNECT_IVL: Retrieve reconnection interval
|
||||
The 'ZMQ_RECONNECT_IVL' option shall retrieve the initial reconnection interval
|
||||
for the specified 'socket'. The reconnection interval is the period 0MQ shall
|
||||
wait between attempts to reconnect disconnected peers when using
|
||||
connection-oriented transports.
|
||||
connection-oriented transports. The value -1 means no reconnection.
|
||||
|
||||
NOTE: The reconnection interval may be randomized by 0MQ to prevent
|
||||
reconnection storms in topologies with a large number of peers per socket.
|
||||
|
@@ -232,7 +232,7 @@ ZMQ_RECONNECT_IVL: Set reconnection interval
|
||||
The 'ZMQ_RECONNECT_IVL' option shall set the initial reconnection interval for
|
||||
the specified 'socket'. The reconnection interval is the period 0MQ
|
||||
shall wait between attempts to reconnect disconnected peers when using
|
||||
connection-oriented transports.
|
||||
connection-oriented transports. The value -1 means no reconnection.
|
||||
|
||||
NOTE: The reconnection interval may be randomized by 0MQ to prevent
|
||||
reconnection storms in topologies with a large number of peers per socket.
|
||||
|
@@ -140,7 +140,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
if (*((int*) optval_) < 0) {
|
||||
if (*((int*) optval_) < -1) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
@@ -375,6 +375,7 @@ void zmq::session_base_t::detached ()
|
||||
}
|
||||
|
||||
// Reconnect.
|
||||
if (options.reconnect_ivl != -1)
|
||||
start_connecting (true);
|
||||
|
||||
// For subscriber sockets we hiccup the inbound pipe, which will cause
|
||||
|
Reference in New Issue
Block a user