Merge pull request #2252 from mathieui/traversal-timeout
NetPlay: Don’t wait forever in the traversal client
This commit is contained in:
commit
f8a4d4702c
|
@ -137,6 +137,9 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
|
||||||
OnTraversalStateChanged();
|
OnTraversalStateChanged();
|
||||||
m_connecting = true;
|
m_connecting = true;
|
||||||
|
|
||||||
|
Common::Timer connect_timer;
|
||||||
|
connect_timer.Start();
|
||||||
|
|
||||||
while (m_connecting)
|
while (m_connecting)
|
||||||
{
|
{
|
||||||
ENetEvent netEvent;
|
ENetEvent netEvent;
|
||||||
|
@ -160,6 +163,8 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (connect_timer.GetTimeElapsed() > 5000)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
PanicAlertT("Failed To Connect!");
|
PanicAlertT("Failed To Connect!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue