From 750ad293ff3148b108634b73cfc40b9774300b43 Mon Sep 17 00:00:00 2001 From: AljazD Date: Wed, 10 Dec 2025 12:24:24 +0100 Subject: [PATCH 1/2] Added immediate ACKs on Windows, similar to TCP_QUICKACK --- src/pc/protocols/tcpip_host.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pc/protocols/tcpip_host.cpp b/src/pc/protocols/tcpip_host.cpp index 3964c18..aac32b6 100644 --- a/src/pc/protocols/tcpip_host.cpp +++ b/src/pc/protocols/tcpip_host.cpp @@ -1116,6 +1116,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, _WSAIOW(IOC_VENDOR, 23), &freq, sizeof(freq), NULL, 0, &bytes, NULL, NULL) != 0) + { + mvLog(MVLOG_WARN, "WSAIoctl _WSAIOW(IOC_VENDOR, 23) could not be set"); + } +#endif + #if defined(TCP_QUICKACK) if(tcpip_setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, &on, sizeof(on)) < 0) { From a3439476d2b776316efadc210f3b61374344b6b6 Mon Sep 17 00:00:00 2001 From: AljazD Date: Thu, 11 Dec 2025 14:19:01 +0100 Subject: [PATCH 2/2] Code cleanup --- src/pc/protocols/tcpip_host.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/protocols/tcpip_host.cpp b/src/pc/protocols/tcpip_host.cpp index aac32b6..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 @@ -1120,9 +1121,9 @@ int tcpipPlatformConnect(const char *devPathRead, const char *devPathWrite, void // Force immediate ACKs int freq = 1; DWORD bytes; - if(WSAIoctl(sock, _WSAIOW(IOC_VENDOR, 23), &freq, sizeof(freq), NULL, 0, &bytes, NULL, NULL) != 0) + if(WSAIoctl(sock, SIO_TCP_SET_ACK_FREQUENCY, &freq, sizeof(freq), NULL, 0, &bytes, NULL, NULL) != 0) { - mvLog(MVLOG_WARN, "WSAIoctl _WSAIOW(IOC_VENDOR, 23) could not be set"); + mvLog(MVLOG_WARN, "WSAIoctl SIO_TCP_SET_ACK_FREQUENCY could not be set"); } #endif