From e839be9f5b1ea1d5a7eb8dab860a79683cbe997d Mon Sep 17 00:00:00 2001 From: kitswas <90329875+kitswas@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:44:05 +0530 Subject: [PATCH] Set LowDelayOption to true on TCP socket Disables Nagle's algorithm to avoid delay and bunching of small packages. --- src/networking/server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/networking/server.cpp b/src/networking/server.cpp index 98a6d8b..feb0d4d 100644 --- a/src/networking/server.cpp +++ b/src/networking/server.cpp @@ -121,6 +121,8 @@ void Server::initServer() void Server::handleConnection() { clientConnection = tcpServer->nextPendingConnection(); + // disable Nagle's algorithm to avoid delay and bunching of small packages + clientConnection->setSocketOption(QAbstractSocket::LowDelayOption, 1); isGamepadConnected = true; QString connectionMessage; connectionMessage =