mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #10511 from Techjar/netplay-longer-timeout-2-electric-boogaloo
NetPlay: Add timeout to traversal code path
This commit is contained in:
@ -153,7 +153,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Extend reliable traffic timeout
|
// Extend reliable traffic timeout
|
||||||
enet_peer_timeout(m_server, 0, 30000, 30000);
|
enet_peer_timeout(m_server, 0, PEER_TIMEOUT, PEER_TIMEOUT);
|
||||||
|
|
||||||
ENetEvent netEvent;
|
ENetEvent netEvent;
|
||||||
int net = enet_host_service(m_client, &netEvent, 5000);
|
int net = enet_host_service(m_client, &netEvent, 5000);
|
||||||
@ -210,6 +210,10 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
|
|||||||
{
|
{
|
||||||
case ENET_EVENT_TYPE_CONNECT:
|
case ENET_EVENT_TYPE_CONNECT:
|
||||||
m_server = netEvent.peer;
|
m_server = netEvent.peer;
|
||||||
|
|
||||||
|
// Extend reliable traffic timeout
|
||||||
|
enet_peer_timeout(m_server, 0, PEER_TIMEOUT, PEER_TIMEOUT);
|
||||||
|
|
||||||
if (Connect())
|
if (Connect())
|
||||||
{
|
{
|
||||||
m_connection_state = ConnectionState::Connected;
|
m_connection_state = ConnectionState::Connected;
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
namespace NetPlay
|
namespace NetPlay
|
||||||
{
|
{
|
||||||
|
constexpr u32 PEER_TIMEOUT = 30000;
|
||||||
|
|
||||||
bool CompressFileIntoPacket(const std::string& file_path, sf::Packet& packet);
|
bool CompressFileIntoPacket(const std::string& file_path, sf::Packet& packet);
|
||||||
bool CompressFolderIntoPacket(const std::string& folder_path, sf::Packet& packet);
|
bool CompressFolderIntoPacket(const std::string& folder_path, sf::Packet& packet);
|
||||||
bool CompressBufferIntoPacket(const std::vector<u8>& in_buffer, sf::Packet& packet);
|
bool CompressBufferIntoPacket(const std::vector<u8>& in_buffer, sf::Packet& packet);
|
||||||
|
@ -417,7 +417,7 @@ ConnectionError NetPlayServer::OnConnect(ENetPeer* socket, sf::Packet& rpac)
|
|||||||
return ConnectionError::NameTooLong;
|
return ConnectionError::NameTooLong;
|
||||||
|
|
||||||
// Extend reliable traffic timeout
|
// Extend reliable traffic timeout
|
||||||
enet_peer_timeout(socket, 0, 30000, 30000);
|
enet_peer_timeout(socket, 0, PEER_TIMEOUT, PEER_TIMEOUT);
|
||||||
|
|
||||||
// cause pings to be updated
|
// cause pings to be updated
|
||||||
m_update_pings = true;
|
m_update_pings = true;
|
||||||
|
Reference in New Issue
Block a user