Kore Update

This commit is contained in:
Gorochu
2026-06-09 12:45:01 -07:00
parent a2d5c9aea4
commit 7558d03739
371 changed files with 30188 additions and 7466 deletions

View File

@ -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