feat(udp): Increase recv buffer length to avoid packet loss

This commit is contained in:
Σrebe - Romain GERARD 2023-11-02 09:05:22 +01:00
parent 9883b8b32b
commit d8747443d6
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4
2 changed files with 34 additions and 17 deletions

View file

@ -19,8 +19,8 @@ pub(super) async fn propagate_read(
info!("Closing local tx ==> websocket tx tunnel");
});
static JUMBO_FRAME_SIZE: usize = 9 * 1024; // enough for a jumbo frame
let mut buffer = vec![0u8; JUMBO_FRAME_SIZE];
static MAX_PACKET_LENGTH: usize = 64 * 1024;
let mut buffer = vec![0u8; MAX_PACKET_LENGTH];
// We do our own pin_mut! to avoid shadowing timeout and be able to reset it, on next loop iteration
// We reuse the future to avoid creating a timer in the tight loop