mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-16 03:46:54 -04:00
Set TCP_QUICKACK on Linux to improve responsiveness when using client/service configuration
This commit is contained in:
@@ -26,14 +26,18 @@
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
|
||||
const char yes = 1;
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
const int yes = 1;
|
||||
#else
|
||||
const char yes = 1;
|
||||
#endif
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
NetworkClientInfo::NetworkClientInfo()
|
||||
@@ -548,6 +552,13 @@ int NetworkServer::recv_select(SOCKET s, char *buf, int len, int flags)
|
||||
}
|
||||
else
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Set QUICKACK socket option on Linux to improve |
|
||||
| performance |
|
||||
\*-------------------------------------------------*/
|
||||
#ifdef __linux__
|
||||
setsockopt(s, IPPROTO_TCP, TCP_QUICKACK, &yes, sizeof(yes));
|
||||
#endif
|
||||
return(recv(s, buf, len, flags));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user