From a91ccc4fab311035bde74a83996a8ce8f34f76a3 Mon Sep 17 00:00:00 2001 From: Sage King Date: Sat, 6 Aug 2022 14:41:25 -0600 Subject: [PATCH] Reduce time for NetPlayClient to disconnect or fail to connect by adjusting timeouts on enet_host_service calls --- Source/Core/Core/NetPlayClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 05c6779e24..c7e4533634 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -157,7 +157,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay enet_peer_timeout(m_server, 0, PEER_TIMEOUT.count(), PEER_TIMEOUT.count()); ENetEvent netEvent; - int net = enet_host_service(m_client, &netEvent, 5000); + int net = enet_host_service(m_client, &netEvent, 1000); if (net > 0 && netEvent.type == ENET_EVENT_TYPE_CONNECT) { if (Connect()) @@ -1499,7 +1499,7 @@ void NetPlayClient::Disconnect() else return; - while (enet_host_service(m_client, &netEvent, 3000) > 0) + while (enet_host_service(m_client, &netEvent, 500) > 0) { switch (netEvent.type) {