mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
Problem: ZMQ_TCP_RETRANSMIT_TIMEOUT is a clumsy name
Solution: rename to ZMQ_MAXRT This is the option name used on Windows, so easier to use and remember.
This commit is contained in:
parent
5eccd874d6
commit
da8ce55a14
@ -700,14 +700,13 @@ Default value:: -1 (leave to OS default)
|
|||||||
Applicable socket types:: all, when using TCP transports.
|
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
|
On OSes where it is supported, retrieves how long before an unacknowledged TCP
|
||||||
retransmit times out.
|
retransmit times out. The system normally attempts many TCP retransmits
|
||||||
The system normally attempts many TCP retransmits following an exponential
|
following an exponential backoff strategy. This means that after a network
|
||||||
backoff strategy. This means that after a network outage, it may take a long
|
outage, it may take a long time before the session can be re-established.
|
||||||
time before the session can be re-established. Setting this option allows
|
Setting this option allows the timeout to happen at a shorter interval.
|
||||||
the timeout to happen at a shorter interval.
|
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
Option value type:: int
|
Option value type:: int
|
||||||
|
@ -870,14 +870,13 @@ Default value:: -1 (leave to OS default)
|
|||||||
Applicable socket types:: all, when using TCP transports.
|
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
|
On OSes where it is supported, sets how long before an unacknowledged TCP
|
||||||
retransmit times out.
|
retransmit times out. The system normally attempts many TCP retransmits
|
||||||
The system normally attempts many TCP retransmits following an exponential
|
following an exponential backoff strategy. This means that after a network
|
||||||
backoff strategy. This means that after a network outage, it may take a long
|
outage, it may take a long time before the session can be re-established.
|
||||||
time before the session can be re-established. Setting this option allows
|
Setting this option allows the timeout to happen at a shorter interval.
|
||||||
the timeout to happen at a shorter interval.
|
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
Option value type:: int
|
Option value type:: int
|
||||||
|
@ -325,6 +325,8 @@ ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg);
|
|||||||
#define ZMQ_HANDSHAKE_IVL 66
|
#define ZMQ_HANDSHAKE_IVL 66
|
||||||
#define ZMQ_SOCKS_PROXY 68
|
#define ZMQ_SOCKS_PROXY 68
|
||||||
#define ZMQ_XPUB_NODROP 69
|
#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_BLOCKY 70
|
||||||
#define ZMQ_XPUB_MANUAL 71
|
#define ZMQ_XPUB_MANUAL 71
|
||||||
#define ZMQ_XPUB_WELCOME_MSG 72
|
#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_HEARTBEAT_TIMEOUT 77
|
||||||
#define ZMQ_XPUB_VERBOSE_UNSUBSCRIBE 78
|
#define ZMQ_XPUB_VERBOSE_UNSUBSCRIBE 78
|
||||||
#define ZMQ_CONNECT_TIMEOUT 79
|
#define ZMQ_CONNECT_TIMEOUT 79
|
||||||
#define ZMQ_TCP_RETRANSMIT_TIMEOUT 80
|
#define ZMQ_TCP_MAXRT 80
|
||||||
#define ZMQ_THREAD_SAFE 81
|
#define ZMQ_THREAD_SAFE 81
|
||||||
#define ZMQ_TCP_RECV_BUFFER 82
|
#define ZMQ_TCP_RECV_BUFFER 82
|
||||||
#define ZMQ_TCP_SEND_BUFFER 83
|
#define ZMQ_TCP_SEND_BUFFER 83
|
||||||
|
@ -48,7 +48,7 @@ zmq::options_t::options_t () :
|
|||||||
type (-1),
|
type (-1),
|
||||||
linger (-1),
|
linger (-1),
|
||||||
connect_timeout (0),
|
connect_timeout (0),
|
||||||
tcp_retransmit_timeout (0),
|
tcp_maxrt (0),
|
||||||
reconnect_ivl (100),
|
reconnect_ivl (100),
|
||||||
reconnect_ivl_max (0),
|
reconnect_ivl_max (0),
|
||||||
backlog (100),
|
backlog (100),
|
||||||
@ -178,9 +178,9 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZMQ_TCP_RETRANSMIT_TIMEOUT:
|
case ZMQ_TCP_MAXRT:
|
||||||
if (is_int && value >= 0) {
|
if (is_int && value >= 0) {
|
||||||
tcp_retransmit_timeout = value;
|
tcp_maxrt = value;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -745,9 +745,9 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZMQ_TCP_RETRANSMIT_TIMEOUT:
|
case ZMQ_TCP_MAXRT:
|
||||||
if (is_int) {
|
if (is_int) {
|
||||||
*value = tcp_retransmit_timeout;
|
*value = tcp_maxrt;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -104,7 +104,7 @@ namespace zmq
|
|||||||
// Maximum interval in milliseconds beyond which TCP will timeout
|
// Maximum interval in milliseconds beyond which TCP will timeout
|
||||||
// retransmitted packets.
|
// retransmitted packets.
|
||||||
// Default 0 (unused)
|
// Default 0 (unused)
|
||||||
int tcp_retransmit_timeout;
|
int tcp_maxrt;
|
||||||
|
|
||||||
// Minimum interval between attempts to reconnect, in milliseconds.
|
// Minimum interval between attempts to reconnect, in milliseconds.
|
||||||
// Default 100ms
|
// Default 100ms
|
||||||
|
@ -153,7 +153,7 @@ void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int
|
|||||||
#endif // ZMQ_HAVE_WINDOWS
|
#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)
|
if (timeout_ <= 0)
|
||||||
return;
|
return;
|
||||||
|
@ -47,8 +47,8 @@ namespace zmq
|
|||||||
// Tunes TCP keep-alives
|
// Tunes TCP keep-alives
|
||||||
void tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_);
|
void tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_);
|
||||||
|
|
||||||
// Tunes TCP retransmit timeout
|
// Tunes TCP max retransmit timeout
|
||||||
void tune_tcp_retransmit_timeout (fd_t sockfd_, int timeout_);
|
void tune_tcp_maxrt (fd_t sockfd_, int timeout_);
|
||||||
|
|
||||||
// Writes data to the socket. Returns the number of bytes actually
|
// Writes data to the socket. Returns the number of bytes actually
|
||||||
// written (even zero is to be considered to be a success). In case
|
// written (even zero is to be considered to be a success). In case
|
||||||
|
@ -146,7 +146,7 @@ void zmq::tcp_connecter_t::out_event ()
|
|||||||
|
|
||||||
tune_tcp_socket (fd);
|
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_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
|
// remember our fd for ZMQ_SRCFD in messages
|
||||||
socket->set_fd (fd);
|
socket->set_fd (fd);
|
||||||
|
@ -100,7 +100,7 @@ void zmq::tcp_listener_t::in_event ()
|
|||||||
|
|
||||||
tune_tcp_socket (fd);
|
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_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
|
// remember our fd for ZMQ_SRCFD in messages
|
||||||
socket->set_fd(fd);
|
socket->set_fd(fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user