mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Wait for ENet socket readability rather than just sleeping 10 ms
This commit is contained in:
parent
43eb36e17a
commit
97216e1704
@ -683,12 +683,15 @@ static void controlReceiveThreadFunc(void* context) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
// No events ready - sleep for a short time
|
||||
// No events ready - wait for readability.
|
||||
//
|
||||
// NOTE: This sleep *directly* impacts the lowest possible retransmission
|
||||
// NOTE: This wait *directly* impacts the lowest possible retransmission
|
||||
// time for packets after a loss event. If we're busy sleeping here, we can't
|
||||
// retransmit a dropped packet, so we keep the sleep time to a minimum.
|
||||
PltSleepMsInterruptible(&controlReceiveThread, 10);
|
||||
//
|
||||
// TODO: Dynamically sleep until next RTO rather than waking every 10 ms
|
||||
enet_uint32 condition = ENET_SOCKET_WAIT_RECEIVE;
|
||||
enet_socket_wait(client->socket, &condition, 10);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user