mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 04:17:57 +01:00
add ZMQ_CONNECT_TIMEOUT socket option
This commit is contained in:
@@ -46,6 +46,7 @@ zmq::options_t::options_t () :
|
||||
tos (0),
|
||||
type (-1),
|
||||
linger (-1),
|
||||
connect_timeout (0),
|
||||
reconnect_ivl (100),
|
||||
reconnect_ivl_max (0),
|
||||
backlog (100),
|
||||
@@ -158,6 +159,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
}
|
||||
break;
|
||||
|
||||
case ZMQ_CONNECT_TIMEOUT:
|
||||
if (is_int && value >= 0) {
|
||||
connect_timeout = value;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case ZMQ_RECONNECT_IVL:
|
||||
if (is_int && value >= -1) {
|
||||
reconnect_ivl = value;
|
||||
@@ -653,6 +661,13 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
|
||||
}
|
||||
break;
|
||||
|
||||
case ZMQ_CONNECT_TIMEOUT:
|
||||
if (is_int) {
|
||||
*value = connect_timeout;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case ZMQ_RECONNECT_IVL:
|
||||
if (is_int) {
|
||||
*value = reconnect_ivl;
|
||||
|
||||
Reference in New Issue
Block a user