mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-11 09:05:38 +00:00
Added an option to Disable Nagle Algorithm (Enable TCP No Delay)
This commit is contained in:
parent
68fa15784c
commit
65bc68609c
@ -958,6 +958,7 @@ static ConfigSetting networkSettings[] = {
|
|||||||
ConfigSetting("proAdhocServer", &g_Config.proAdhocServer, "myneighborsushicat.com", true, true),
|
ConfigSetting("proAdhocServer", &g_Config.proAdhocServer, "myneighborsushicat.com", true, true),
|
||||||
ConfigSetting("PortOffset", &g_Config.iPortOffset, 0, true, true),
|
ConfigSetting("PortOffset", &g_Config.iPortOffset, 0, true, true),
|
||||||
ConfigSetting("MinTimeout", &g_Config.iMinTimeout, 1, true, true),
|
ConfigSetting("MinTimeout", &g_Config.iMinTimeout, 1, true, true),
|
||||||
|
ConfigSetting("TCPNoDelay", &g_Config.bTCPNoDelay, false, true, true),
|
||||||
ConfigSetting("EnableUPnP", &g_Config.bEnableUPnP, false, true, true),
|
ConfigSetting("EnableUPnP", &g_Config.bEnableUPnP, false, true, true),
|
||||||
ConfigSetting("UPnPUseOriginalPort", &g_Config.bUPnPUseOriginalPort, true, true, true),
|
ConfigSetting("UPnPUseOriginalPort", &g_Config.bUPnPUseOriginalPort, true, true, true),
|
||||||
|
|
||||||
|
@ -411,6 +411,7 @@ public:
|
|||||||
std::string proAdhocServer;
|
std::string proAdhocServer;
|
||||||
bool bEnableWlan;
|
bool bEnableWlan;
|
||||||
bool bEnableAdhocServer;
|
bool bEnableAdhocServer;
|
||||||
|
bool bTCPNoDelay;
|
||||||
bool bEnableUPnP;
|
bool bEnableUPnP;
|
||||||
bool bUPnPUseOriginalPort;
|
bool bUPnPUseOriginalPort;
|
||||||
int iPortOffset;
|
int iPortOffset;
|
||||||
|
@ -1917,7 +1917,7 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
|
|||||||
setSockTimeout(tcpsocket, SO_SNDTIMEO, rexmt_int);
|
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?
|
// Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function?
|
||||||
//setSockNoDelay(tcpsocket, 1);
|
if (g_Config.bTCPNoDelay) setSockNoDelay(tcpsocket, 1);
|
||||||
|
|
||||||
// Binding Information for local Port
|
// Binding Information for local Port
|
||||||
sockaddr_in addr;
|
sockaddr_in addr;
|
||||||
@ -2107,7 +2107,7 @@ static int sceNetAdhocPtpAccept(int id, u32 peerMacAddrPtr, u32 peerPortPtr, int
|
|||||||
setsockopt(newsocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&one, sizeof(one));
|
setsockopt(newsocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&one, sizeof(one));
|
||||||
|
|
||||||
// Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function?
|
// Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function?
|
||||||
//setSockNoDelay(newsocket, 1);
|
if (g_Config.bTCPNoDelay) setSockNoDelay(newsocket, 1);
|
||||||
|
|
||||||
// Grab Local Address
|
// Grab Local Address
|
||||||
if (getsockname(newsocket, (sockaddr *)&local, &locallen) == 0) {
|
if (getsockname(newsocket, (sockaddr *)&local, &locallen) == 0) {
|
||||||
@ -2444,7 +2444,7 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int
|
|||||||
setSockTimeout(tcpsocket, SO_RCVTIMEO, rexmt_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?
|
// Disable Nagle Algo to send immediately. Or may be we shouldn't disable Nagle since there is PtpFlush function?
|
||||||
//setSockNoDelay(tcpsocket, 1);
|
if (g_Config.bTCPNoDelay) setSockNoDelay(tcpsocket, 1);
|
||||||
|
|
||||||
// Binding Information for local Port
|
// Binding Information for local Port
|
||||||
sockaddr_in addr;
|
sockaddr_in addr;
|
||||||
|
@ -699,6 +699,7 @@ void GameSettingsScreen::CreateViews() {
|
|||||||
}
|
}
|
||||||
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.iPortOffset, 0, 60000, n->T("Port offset", "Port offset (0 = PSP compatibility)"), 100, screenManager()));
|
||||||
networkingSettings->Add(new PopupSliderChoice(&g_Config.iMinTimeout, 1, 15000, n->T("Minimum Timeout", "Minimum Timeout (override low latency in ms)"), 100, screenManager()));
|
networkingSettings->Add(new PopupSliderChoice(&g_Config.iMinTimeout, 1, 15000, n->T("Minimum Timeout", "Minimum Timeout (override low latency in ms)"), 100, screenManager()));
|
||||||
|
networkingSettings->Add(new CheckBox(&g_Config.bTCPNoDelay, n->T("TCP No Delay", "TCP No Delay (faster TCP)")));
|
||||||
|
|
||||||
networkingSettings->Add(new ItemHeader(n->T("UPnP")));
|
networkingSettings->Add(new ItemHeader(n->T("UPnP")));
|
||||||
networkingSettings->Add(new CheckBox(&g_Config.bEnableUPnP, n->T("Enable UPnP", "Enable UPnP (need a few seconds to detect)")));
|
networkingSettings->Add(new CheckBox(&g_Config.bEnableUPnP, n->T("Enable UPnP", "Enable UPnP (need a few seconds to detect)")));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user