Commit 7d6d2f94 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #278 from taurel/master

Disable reconnection option
parents 5973da48 10758121
...@@ -223,7 +223,7 @@ ZMQ_RECONNECT_IVL: Retrieve reconnection interval ...@@ -223,7 +223,7 @@ ZMQ_RECONNECT_IVL: Retrieve reconnection interval
The 'ZMQ_RECONNECT_IVL' option shall retrieve the initial 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 for the specified 'socket'. The reconnection interval is the period 0MQ shall
wait between attempts to reconnect disconnected peers when using 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 NOTE: The reconnection interval may be randomized by 0MQ to prevent
reconnection storms in topologies with a large number of peers per socket. reconnection storms in topologies with a large number of peers per socket.
......
...@@ -232,7 +232,7 @@ ZMQ_RECONNECT_IVL: Set reconnection interval ...@@ -232,7 +232,7 @@ ZMQ_RECONNECT_IVL: Set reconnection interval
The 'ZMQ_RECONNECT_IVL' option shall set the initial reconnection interval for The 'ZMQ_RECONNECT_IVL' option shall set the initial reconnection interval for
the specified 'socket'. The reconnection interval is the period 0MQ the specified 'socket'. The reconnection interval is the period 0MQ
shall wait between attempts to reconnect disconnected peers when using 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 NOTE: The reconnection interval may be randomized by 0MQ to prevent
reconnection storms in topologies with a large number of peers per socket. 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_, ...@@ -140,7 +140,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
if (*((int*) optval_) < 0) { if (*((int*) optval_) < -1) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
...@@ -375,6 +375,7 @@ void zmq::session_base_t::detached () ...@@ -375,6 +375,7 @@ void zmq::session_base_t::detached ()
} }
// Reconnect. // Reconnect.
if (options.reconnect_ivl != -1)
start_connecting (true); start_connecting (true);
// For subscriber sockets we hiccup the inbound pipe, which will cause // For subscriber sockets we hiccup the inbound pipe, which will cause
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment