From 620e003c10d497d2038e0bc2d576c0254bf4ae8f Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Mon, 1 Mar 2021 01:45:04 +0700 Subject: [PATCH] Removing TCPNoDelay option from Networking Settings and always enable it to improve response time. --- Core/Config.cpp | 2 +- Core/HLE/sceNetAdhoc.cpp | 9 +++------ UI/GameSettingsScreen.cpp | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index bf95896234..353e3b19d4 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -968,7 +968,7 @@ static ConfigSetting networkSettings[] = { ConfigSetting("proAdhocServer", &g_Config.proAdhocServer, "myneighborsushicat.com", true, true), ConfigSetting("PortOffset", &g_Config.iPortOffset, 0, true, true), ConfigSetting("MinTimeout", &g_Config.iMinTimeout, 0, true, true), - ConfigSetting("TCPNoDelay", &g_Config.bTCPNoDelay, false, true, true), + ConfigSetting("TCPNoDelay", &g_Config.bTCPNoDelay, true, true, true), ConfigSetting("ForcedFirstConnect", &g_Config.bForcedFirstConnect, false, true, true), ConfigSetting("EnableUPnP", &g_Config.bEnableUPnP, false, true, true), ConfigSetting("UPnPUseOriginalPort", &g_Config.bUPnPUseOriginalPort, false, true, true), diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index e07e3483ce..ce7e2b4456 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -3148,8 +3148,7 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac, setSockTimeout(tcpsocket, SO_SNDTIMEO, rexmt_int); // Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function? - if (g_Config.bTCPNoDelay) - setSockNoDelay(tcpsocket, 1); + setSockNoDelay(tcpsocket, 1); // Binding Information for local Port struct sockaddr_in addr; @@ -3267,8 +3266,7 @@ int AcceptPtpSocket(int ptpId, int newsocket, sockaddr_in& peeraddr, SceNetEther setSockReuseAddrPort(newsocket); // Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function? - if (g_Config.bTCPNoDelay) - setSockNoDelay(newsocket, 1); + setSockNoDelay(newsocket, 1); // Local Address Information struct sockaddr_in local; @@ -3713,8 +3711,7 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int setSockTimeout(tcpsocket, SO_RCVTIMEO, rexmt_int); // Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function? - if (g_Config.bTCPNoDelay) - setSockNoDelay(tcpsocket, 1); + setSockNoDelay(tcpsocket, 1); // Binding Information for local Port struct sockaddr_in addr; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 526eafd389..413dbd820b 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -835,7 +835,6 @@ void GameSettingsScreen::CreateViews() { networkingSettings->Add(new ItemHeader(n->T("Misc", "Misc (default = compatibility)"))); networkingSettings->Add(new PopupSliderChoice(&g_Config.iPortOffset, 0, 60000, n->T("Port offset", "Port offset (0 = PSP compatibility)"), 100, screenManager())); networkingSettings->Add(new PopupSliderChoice(&g_Config.iMinTimeout, 0, 15000, n->T("Minimum Timeout", "Minimum Timeout (override in ms, 0 = default)"), 50, screenManager())); - networkingSettings->Add(new CheckBox(&g_Config.bTCPNoDelay, n->T("TCP No Delay", "TCP No Delay (faster TCP)"))); networkingSettings->Add(new CheckBox(&g_Config.bForcedFirstConnect, n->T("Forced First Connect", "Forced First Connect (faster Connect)"))); ViewGroup *toolsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));