forked from LeenkxTeam/LNXRNT
Kore Update
This commit is contained in:
@ -41,8 +41,8 @@ namespace SocketOptimization {
|
||||
|
||||
// disable Nagle
|
||||
int tcp_quickack = 1;
|
||||
#ifndef _WIN32
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_QUICKACK,
|
||||
#ifdef __linux__
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_QUICKACK,
|
||||
(const char*)&tcp_quickack, sizeof(tcp_quickack));
|
||||
#endif
|
||||
|
||||
@ -63,8 +63,12 @@ namespace SocketOptimization {
|
||||
int keepidle = 30; // start probes after 30 seconds
|
||||
int keepintvl = 5; // probe every 5 seconds
|
||||
int keepcnt = 3; // 3 failed probes before timeout
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
|
||||
#elif defined(__APPLE__)
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_KEEPALIVE, &keepidle, sizeof(keepidle));
|
||||
#endif
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
|
||||
setsockopt(socket_fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user