Ensure that every udp socket can connect at the same time

This commit is contained in:
Michael Watzko 2021-04-08 00:24:10 +02:00
commit ee415c63f0

View file

@ -199,7 +199,7 @@ where
) -> Result<(), Self::Error> {
if let SocketAddr::V4(remote) = remote {
// TODO dynamically select a random port
socket.open(&mut self.bus, 49849)?; // chosen by fair dice roll.
socket.open(&mut self.bus, 49849 + u16::from(socket.socket.index))?; // chosen by fair dice roll.
// guaranteed to be random.
socket.set_destination(&mut self.bus, remote)?;
Ok(())