add ZMQ_TCP_RETRANSMIT_TIMEOUT socket option

This commit is contained in:
KIU Shueng Chuan
2015-08-06 23:36:27 +08:00
parent 064c2e0836
commit ca9215de1e
8 changed files with 74 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ zmq::options_t::options_t () :
type (-1),
linger (-1),
connect_timeout (0),
tcp_retransmit_timeout (0),
reconnect_ivl (100),
reconnect_ivl_max (0),
backlog (100),
@@ -166,6 +167,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break;
case ZMQ_TCP_RETRANSMIT_TIMEOUT:
if (is_int && value >= 0) {
tcp_retransmit_timeout = value;
return 0;
}
break;
case ZMQ_RECONNECT_IVL:
if (is_int && value >= -1) {
reconnect_ivl = value;
@@ -668,6 +676,13 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break;
case ZMQ_TCP_RETRANSMIT_TIMEOUT:
if (is_int) {
*value = tcp_retransmit_timeout;
return 0;
}
break;
case ZMQ_RECONNECT_IVL:
if (is_int) {
*value = reconnect_ivl;