mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Set TCP_NODELAY for !linux for raw sockets.
This commit is contained in:
parent
0676a1a885
commit
a7cbbc9fc3
14
util.c
14
util.c
@ -207,15 +207,21 @@ static void keep_sockalive(SOCKETTYPE fd)
|
|||||||
|
|
||||||
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *)&tcp_one, sizeof(tcp_one));
|
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *)&tcp_one, sizeof(tcp_one));
|
||||||
if (!opt_delaynet)
|
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));
|
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_KEEPCNT, &tcp_one, sizeof(tcp_one));
|
||||||
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle));
|
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle));
|
||||||
setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
||||||
# endif /* __linux */
|
#endif /* __linux */
|
||||||
# ifdef __APPLE_CC__
|
|
||||||
|
#ifdef __APPLE_CC__
|
||||||
setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl));
|
||||||
# endif /* __APPLE_CC__ */
|
#endif /* __APPLE_CC__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CURL_HAS_KEEPALIVE
|
#if CURL_HAS_KEEPALIVE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user