diff --git a/doc/zmq_getsockopt.txt b/doc/zmq_getsockopt.txt index d52ecab4..9293bc9b 100644 --- a/doc/zmq_getsockopt.txt +++ b/doc/zmq_getsockopt.txt @@ -700,14 +700,13 @@ Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. -ZMQ_TCP_RETRANSMIT_TIMEOUT: Retrieve TCP Retransmit Timeout -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ZMQ_TCP_MAXRT: Retrieve Max TCP Retransmit Timeout +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On OSes where it is supported, retrieves how long before an unacknowledged TCP -retransmit times out. -The system normally attempts many TCP retransmits following an exponential -backoff strategy. This means that after a network outage, it may take a long -time before the session can be re-established. Setting this option allows -the timeout to happen at a shorter interval. +retransmit times out. The system normally attempts many TCP retransmits +following an exponential backoff strategy. This means that after a network +outage, it may take a long time before the session can be re-established. +Setting this option allows the timeout to happen at a shorter interval. [horizontal] Option value type:: int diff --git a/doc/zmq_setsockopt.txt b/doc/zmq_setsockopt.txt index 6059834a..583578fe 100644 --- a/doc/zmq_setsockopt.txt +++ b/doc/zmq_setsockopt.txt @@ -870,14 +870,13 @@ Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. -ZMQ_TCP_RETRANSMIT_TIMEOUT: Set TCP Retransmit Timeout +ZMQ_TCP_MAXRT: Set TCP Maximum Retransmit Timeout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On OSes where it is supported, sets how long before an unacknowledged TCP -retransmit times out. -The system normally attempts many TCP retransmits following an exponential -backoff strategy. This means that after a network outage, it may take a long -time before the session can be re-established. Setting this option allows -the timeout to happen at a shorter interval. +retransmit times out. The system normally attempts many TCP retransmits +following an exponential backoff strategy. This means that after a network +outage, it may take a long time before the session can be re-established. +Setting this option allows the timeout to happen at a shorter interval. [horizontal] Option value type:: int diff --git a/include/zmq.h b/include/zmq.h index c99b05ab..14e260f7 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -325,6 +325,8 @@ ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg); #define ZMQ_HANDSHAKE_IVL 66 #define ZMQ_SOCKS_PROXY 68 #define ZMQ_XPUB_NODROP 69 +// All options after this is for version 4.2 and still *draft* +// Subject to arbitrary change without notice #define ZMQ_BLOCKY 70 #define ZMQ_XPUB_MANUAL 71 #define ZMQ_XPUB_WELCOME_MSG 72 @@ -335,7 +337,7 @@ ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg); #define ZMQ_HEARTBEAT_TIMEOUT 77 #define ZMQ_XPUB_VERBOSE_UNSUBSCRIBE 78 #define ZMQ_CONNECT_TIMEOUT 79 -#define ZMQ_TCP_RETRANSMIT_TIMEOUT 80 +#define ZMQ_TCP_MAXRT 80 #define ZMQ_THREAD_SAFE 81 #define ZMQ_TCP_RECV_BUFFER 82 #define ZMQ_TCP_SEND_BUFFER 83 diff --git a/src/options.cpp b/src/options.cpp index 69ec6af0..8553fc8c 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -48,7 +48,7 @@ zmq::options_t::options_t () : type (-1), linger (-1), connect_timeout (0), - tcp_retransmit_timeout (0), + tcp_maxrt (0), reconnect_ivl (100), reconnect_ivl_max (0), backlog (100), @@ -178,9 +178,9 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, } break; - case ZMQ_TCP_RETRANSMIT_TIMEOUT: + case ZMQ_TCP_MAXRT: if (is_int && value >= 0) { - tcp_retransmit_timeout = value; + tcp_maxrt = value; return 0; } break; @@ -745,9 +745,9 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) } break; - case ZMQ_TCP_RETRANSMIT_TIMEOUT: + case ZMQ_TCP_MAXRT: if (is_int) { - *value = tcp_retransmit_timeout; + *value = tcp_maxrt; return 0; } break; diff --git a/src/options.hpp b/src/options.hpp index 80b430fb..896997c2 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -104,7 +104,7 @@ namespace zmq // Maximum interval in milliseconds beyond which TCP will timeout // retransmitted packets. // Default 0 (unused) - int tcp_retransmit_timeout; + int tcp_maxrt; // Minimum interval between attempts to reconnect, in milliseconds. // Default 100ms diff --git a/src/tcp.cpp b/src/tcp.cpp index d557b6e3..bbef7611 100644 --- a/src/tcp.cpp +++ b/src/tcp.cpp @@ -153,7 +153,7 @@ void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int #endif // ZMQ_HAVE_WINDOWS } -void zmq::tune_tcp_retransmit_timeout (fd_t sockfd_, int timeout_) +void zmq::tune_tcp_maxrt (fd_t sockfd_, int timeout_) { if (timeout_ <= 0) return; diff --git a/src/tcp.hpp b/src/tcp.hpp index c12ca723..2ecc8dca 100644 --- a/src/tcp.hpp +++ b/src/tcp.hpp @@ -47,8 +47,8 @@ namespace zmq // Tunes TCP keep-alives void tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_); - // Tunes TCP retransmit timeout - void tune_tcp_retransmit_timeout (fd_t sockfd_, int timeout_); + // Tunes TCP max retransmit timeout + void tune_tcp_maxrt (fd_t sockfd_, int timeout_); // Writes data to the socket. Returns the number of bytes actually // written (even zero is to be considered to be a success). In case diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index fcc415dc..6bc91849 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -146,7 +146,7 @@ void zmq::tcp_connecter_t::out_event () tune_tcp_socket (fd); tune_tcp_keepalives (fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl); - tune_tcp_retransmit_timeout (fd, options.tcp_retransmit_timeout); + tune_tcp_maxrt (fd, options.tcp_maxrt); // remember our fd for ZMQ_SRCFD in messages socket->set_fd (fd); diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp index 89014a3d..63d766c7 100644 --- a/src/tcp_listener.cpp +++ b/src/tcp_listener.cpp @@ -100,7 +100,7 @@ void zmq::tcp_listener_t::in_event () tune_tcp_socket (fd); tune_tcp_keepalives (fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl); - tune_tcp_retransmit_timeout (fd, options.tcp_retransmit_timeout); + tune_tcp_maxrt (fd, options.tcp_maxrt); // remember our fd for ZMQ_SRCFD in messages socket->set_fd(fd);