diff --git a/src/pc/protocols/tcpip_host.cpp b/src/pc/protocols/tcpip_host.cpp index 3964c18..3f17922 100644 --- a/src/pc/protocols/tcpip_host.cpp +++ b/src/pc/protocols/tcpip_host.cpp @@ -33,6 +33,7 @@ #pragma comment(lib, "iphlpapi.lib") #define tcpip_errno WSAGetLastError() #define ERRNO_EAGAIN WSAETIMEDOUT +#define SIO_TCP_SET_ACK_FREQUENCY _WSAIOW(IOC_VENDOR, 23) #else @@ -1116,6 +1117,16 @@ int tcpipPlatformConnect(const char *devPathRead, const char *devPathWrite, void return -1; } +#if (defined(_WIN32) || defined(_WIN64) ) + // Force immediate ACKs + int freq = 1; + DWORD bytes; + if(WSAIoctl(sock, SIO_TCP_SET_ACK_FREQUENCY, &freq, sizeof(freq), NULL, 0, &bytes, NULL, NULL) != 0) + { + mvLog(MVLOG_WARN, "WSAIoctl SIO_TCP_SET_ACK_FREQUENCY could not be set"); + } +#endif + #if defined(TCP_QUICKACK) if(tcpip_setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, &on, sizeof(on)) < 0) {