Set write timeout

No read timeout because who knows if we'll ever receive a packet, but writes shouldn't last long
This commit is contained in:
Michael Bradley 2025-06-02 23:56:00 -04:00
parent cfa763ffc4
commit 3c0590b273
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4

View file

@ -1,6 +1,7 @@
use std::{
io::Result,
net::{Ipv6Addr, UdpSocket},
time::Duration,
};
use crossbeam_channel::unbounded;
@ -12,7 +13,7 @@ use super::{
fn configure_socket(socket: &UdpSocket) -> Result<()> {
socket.set_read_timeout(None)?;
socket.set_write_timeout(None)?;
socket.set_write_timeout(Some(Duration::from_secs(1)))?;
Ok(())
}