mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-03-09 01:30:46 -04:00
Set TCP_QUICKACK on Linux to improve responsiveness when using client/service configuration
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#include <sys/select.h>
|
||||
#include <netinet/tcp.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
const int yes = 1;
|
||||
#else
|
||||
const char yes = 1;
|
||||
#endif
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
@@ -438,6 +445,13 @@ int NetworkClient::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