1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Set TCP_NODELAY for !linux for raw sockets.

This commit is contained in:
ckolivas 2013-05-09 12:08:42 +10:00
parent 0676a1a885
commit a7cbbc9fc3

14
util.c
View File

@ -207,15 +207,21 @@ static void keep_sockalive(SOCKETTYPE fd)
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *)&tcp_one, sizeof(tcp_one));
if (!opt_delaynet)
#ifndef __linux
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&tcp_one, sizeof(tcp_one));
#else /* __linux */
setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&tcp_one, sizeof(tcp_one));
# ifdef __linux
#endif /* __linux */
#ifdef __linux
setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &tcp_one, sizeof(tcp_one));
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle));
setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl));
# endif /* __linux */
# ifdef __APPLE_CC__
#endif /* __linux */
#ifdef __APPLE_CC__
setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl));
# endif /* __APPLE_CC__ */
#endif /* __APPLE_CC__ */
}
#if CURL_HAS_KEEPALIVE