add udp sockets

This commit is contained in:
Toshit Chawda 2024-03-03 10:47:10 -08:00
parent 75c48ccded
commit 5a24f53454
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
9 changed files with 146 additions and 10 deletions

View file

@ -108,7 +108,11 @@ async fn handle_mux(
.map_err(|x| WispError::Other(Box::new(x)))?;
}
StreamType::Udp => {
let udp_socket = UdpSocket::bind(uri)
let udp_socket = UdpSocket::bind("0.0.0.0:0")
.await
.map_err(|x| WispError::Other(Box::new(x)))?;
udp_socket
.connect(uri)
.await
.map_err(|x| WispError::Other(Box::new(x)))?;
let mut data = vec![0u8; 65507]; // udp standard max datagram size