mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-04-21 18:29:08 -05:00
NetPlay: Make the enet interrupts work
Otherwise, it would work but any async sending would be delayed by 4ms or wait until the next packet was received. Also increase the client timeout to 250ms, since enet_host_service is now really interrupted.
This commit is contained in:
@@ -103,7 +103,10 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlay
|
||||
if (net > 0 && netEvent.type == ENET_EVENT_TYPE_CONNECT)
|
||||
{
|
||||
if (Connect())
|
||||
{
|
||||
m_client->intercept = ENetUtil::InterceptCallback;
|
||||
m_thread = std::thread(&NetPlayClient::ThreadFunc, this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -497,7 +500,7 @@ void NetPlayClient::ThreadFunc()
|
||||
int net;
|
||||
if (m_traversal_client)
|
||||
m_traversal_client->HandleResends();
|
||||
net = enet_host_service(m_client, &netEvent, 4);
|
||||
net = enet_host_service(m_client, &netEvent, 250);
|
||||
while (!m_async_queue.Empty())
|
||||
{
|
||||
Send(*(m_async_queue.Front().get()));
|
||||
|
||||
Reference in New Issue
Block a user