chore: update on packet size FIXME

This commit is contained in:
kozabrada123 2024-01-12 17:40:40 +01:00
parent 7a41667ad4
commit 7a3a7dcd8e
1 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,12 @@ impl UdpHandler {
loop { loop {
// FIXME: is there a max size for these packets? // FIXME: is there a max size for these packets?
// Allocating 512 bytes seems a bit extreme // Allocating 512 bytes seems a bit extreme
//
// Update: see <https://stackoverflow.com/questions/58097580/rtp-packet-maximum-size>
// > "The RTP standard does not set a maximum size.."
//
// The theorhetical max for this buffer would be 1458 bytes, but that is imo
// unreasonable to allocate for every message.
let mut buf: Vec<u8> = vec![0; 512]; let mut buf: Vec<u8> = vec![0; 512];
let result = self.socket.recv(&mut buf).await; let result = self.socket.recv(&mut buf).await;