mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 10:33:52 +01:00
Problem: no permission to relicense ZMQ_RECONNECT_IVL_MAX
Solution: remove the implementation. Thijs Terlouw <thijsterlouw@gmail.com>, the author, did not respond to requests to allow relicensing to MPL2, so we have to remove his copyrighted work. Remove the implementation and make get/set return -EOPNOTSUPP.
This commit is contained in:
parent
ff47aeb791
commit
7bbd49726b
@ -619,23 +619,11 @@ Default value:: 100
|
||||
Applicable socket types:: all, only for connection-oriented transports
|
||||
|
||||
|
||||
ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection
|
||||
interval for the specified 'socket'. This is the maximum period 0MQ shall wait
|
||||
between attempts to reconnect. On each reconnect attempt, the previous interval
|
||||
shall be doubled until ZMQ_RECONNECT_IVL_MAX is reached. This allows for
|
||||
exponential backoff strategy. Default value means no exponential backoff is
|
||||
performed and reconnect interval calculations are only based on
|
||||
ZMQ_RECONNECT_IVL.
|
||||
|
||||
NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
|
||||
|
||||
[horizontal]
|
||||
Option value type:: int
|
||||
Option value unit:: milliseconds
|
||||
Default value:: 0 (only use ZMQ_RECONNECT_IVL)
|
||||
Applicable socket types:: all, only for connection-oriented transport
|
||||
ZMQ_RECONNECT_IVL_MAX: DEPRECATED
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_RECONNECT_IVL_MAX option is an empty stub that only returns an
|
||||
*EOPNOTSUPP* error, as the author did not provide a relicense agreement for
|
||||
the Mozilla Public License v2 relicense of libzmq.
|
||||
|
||||
|
||||
ZMQ_RECONNECT_STOP: Retrieve condition where reconnection will stop
|
||||
|
@ -750,22 +750,11 @@ Default value:: 100
|
||||
Applicable socket types:: all, only for connection-oriented transports
|
||||
|
||||
|
||||
ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval
|
||||
for the specified 'socket'. This is the maximum period 0MQ shall wait between
|
||||
attempts to reconnect. On each reconnect attempt, the previous interval shall be
|
||||
doubled until ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
|
||||
backoff strategy. Default value means no exponential backoff is performed and
|
||||
reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.
|
||||
|
||||
NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored.
|
||||
|
||||
[horizontal]
|
||||
Option value type:: int
|
||||
Option value unit:: milliseconds
|
||||
Default value:: 0 (only use ZMQ_RECONNECT_IVL)
|
||||
Applicable socket types:: all, only for connection-oriented transports
|
||||
ZMQ_RECONNECT_IVL_MAX: DEPRECATED
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The 'ZMQ_RECONNECT_IVL_MAX option is an empty stub that only returns an
|
||||
*EOPNOTSUPP* error, as the author did not provide a relicense agreement for
|
||||
the Mozilla Public License v2 relicense of libzmq.
|
||||
|
||||
|
||||
ZMQ_RECONNECT_STOP: Set condition where reconnection will stop
|
||||
|
@ -213,7 +213,6 @@ zmq::options_t::options_t () :
|
||||
tcp_maxrt (0),
|
||||
reconnect_stop (0),
|
||||
reconnect_ivl (100),
|
||||
reconnect_ivl_max (0),
|
||||
backlog (100),
|
||||
maxmsgsize (-1),
|
||||
rcvtimeo (-1),
|
||||
@ -428,11 +427,11 @@ int zmq::options_t::setsockopt (int option_,
|
||||
break;
|
||||
|
||||
case ZMQ_RECONNECT_IVL_MAX:
|
||||
if (is_int && value >= 0) {
|
||||
reconnect_ivl_max = value;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
return WSAEOPNOTSUPP;
|
||||
#else
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
|
||||
case ZMQ_BACKLOG:
|
||||
if (is_int && value >= 0) {
|
||||
@ -1076,11 +1075,11 @@ int zmq::options_t::getsockopt (int option_,
|
||||
break;
|
||||
|
||||
case ZMQ_RECONNECT_IVL_MAX:
|
||||
if (is_int) {
|
||||
*value = reconnect_ivl_max;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
return WSAEOPNOTSUPP;
|
||||
#else
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
|
||||
case ZMQ_BACKLOG:
|
||||
if (is_int) {
|
||||
|
@ -127,10 +127,6 @@ struct options_t
|
||||
// Default 100ms
|
||||
int reconnect_ivl;
|
||||
|
||||
// Maximum interval between attempts to reconnect, in milliseconds.
|
||||
// Default 0 (unused)
|
||||
int reconnect_ivl_max;
|
||||
|
||||
// Maximum backlog for pending connections.
|
||||
int backlog;
|
||||
|
||||
|
@ -123,17 +123,6 @@ int zmq::stream_connecter_base_t::get_new_reconnect_ivl ()
|
||||
? _current_reconnect_ivl + random_jitter
|
||||
: std::numeric_limits<int>::max ();
|
||||
|
||||
// Only change the new current reconnect interval if the maximum reconnect
|
||||
// interval was set and if it's larger than the reconnect interval.
|
||||
if (options.reconnect_ivl_max > 0
|
||||
&& options.reconnect_ivl_max > options.reconnect_ivl) {
|
||||
// Calculate the next interval
|
||||
_current_reconnect_ivl =
|
||||
_current_reconnect_ivl < std::numeric_limits<int>::max () / 2
|
||||
? std::min (_current_reconnect_ivl * 2, options.reconnect_ivl_max)
|
||||
: options.reconnect_ivl_max;
|
||||
}
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user