Cygwin: tcp: Support TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL

Use WSAIoctl(SIO_KEEPALIVE_VALS) on older systems.

Make sure that keep-alive timeout is equivalent to
TCP_KEEPIDLE + TCP_KEEPCNT * TCP_KEEPINTVL on older systems,
even with TCP_KEEPCNT being a fixed value on those systems.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2020-07-01 20:27:10 +02:00
parent 0feb77c260
commit 8ccffddc91
5 changed files with 180 additions and 14 deletions

View File

@@ -41,6 +41,7 @@ struct wincaps
unsigned has_con_esc_rep : 1;
unsigned has_extended_mem_api : 1;
unsigned has_tcp_fastopen : 1;
unsigned has_linux_tcp_keepalive_sockopts : 1;
};
};
@@ -105,6 +106,7 @@ public:
bool IMPLEMENT (has_con_esc_rep)
bool IMPLEMENT (has_extended_mem_api)
bool IMPLEMENT (has_tcp_fastopen)
bool IMPLEMENT (has_linux_tcp_keepalive_sockopts)
void disable_case_sensitive_dirs ()
{