diff options
author | Manuel BACHMANN <tarnyko@tarnyko.net> | 2020-02-04 10:59:38 +0100 |
---|---|---|
committer | Santiago Gimeno <santiago.gimeno@gmail.com> | 2020-02-07 22:52:45 +0100 |
commit | 21aff3b4c430e73da8364ddfcec87746689988b4 (patch) | |
tree | bfcaca076821cd169bffcf924f516de3dab26037 /docs/src | |
parent | fb5a35ee915921a8baf26e02c12ab05853f1b9af (diff) | |
download | libuv-21aff3b4c430e73da8364ddfcec87746689988b4.tar.gz libuv-21aff3b4c430e73da8364ddfcec87746689988b4.zip |
unix: make uv_tcp_keepalive predictable
Current UNIX systems define various defaults for
TCP_KEEPINTVL and TCP_KEEPCNT, which makes the time
between TCP_KEEPIDLE delay is reached and timeout
effectively occurs unpredictable (Linux: /proc/sys
/net/ipv4/tcp_keepalive_intvl;tcp_keepalive_probes).
Do the following: set TCP_KEEPINTVL to 1 second (same
as Win32 default) and TCP_KEEPCNT to 10 times (same
as Win32 hardcoded value).
Fixes: https://github.com/libuv/libuv/issues/2664
PR-URL: https://github.com/libuv/libuv/pull/2669
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/tcp.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/src/tcp.rst b/docs/src/tcp.rst index bcb163ea..3cc8efaa 100644 --- a/docs/src/tcp.rst +++ b/docs/src/tcp.rst @@ -60,6 +60,11 @@ API Enable / disable TCP keep-alive. `delay` is the initial delay in seconds, ignored when `enable` is zero. + After `delay` has been reached, 10 successive probes, each spaced 1 second + from the previous one, will still happen. If the connection is still lost + at the end of this procedure, then the handle is destroyed with a + ``UV_ETIMEDOUT`` error passed to the corresponding callback. + .. c:function:: int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) Enable / disable simultaneous asynchronous accept requests that are |