Windows: the correct way to make TCP_KEEPALIVE work on MinGW

This commit is contained in:
Bert Belder 2011-10-29 02:00:04 +02:00
parent 99b512e890
commit c0792e5405
2 changed files with 5 additions and 1 deletions

View File

@ -71,7 +71,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
if (enable && setsockopt(socket,
IPPROTO_TCP,
SO_KEEPALIVE,
TCP_KEEPALIVE,
(const char*)&delay,
sizeof delay) == -1) {
uv__set_sys_error(handle->loop, errno);

View File

@ -37,6 +37,10 @@
# define SO_UPDATE_CONNECT_CONTEXT 0x7010
#endif
#ifndef TCP_KEEPALIVE
# define TCP_KEEPALIVE 3
#endif
#ifndef IPV6_V6ONLY
#define IPV6_V6ONLY 27
#endif