From 570458c72c2f99b2d534791a079359a5d7d8d51c Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sun, 5 Dec 2021 20:21:11 +0000 Subject: [PATCH] why does multicast quit working on my laptop after a while? --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9048a12..ff5f918 100644 --- a/src/main.rs +++ b/src/main.rs @@ -137,9 +137,8 @@ fn server () -> Result <(), AppError> { let params = CommonParams::default (); let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, params.server_port)).unwrap (); - socket.join_multicast_v4 (¶ms.multicast_addr, &([0u8, 0, 0, 0].into ())).unwrap (); - loop { + socket.join_multicast_v4 (¶ms.multicast_addr, &([0u8, 0, 0, 0].into ())).unwrap (); println! ("Waiting for messages..."); let (req, remote_addr) = recv_msg_from (&socket)?;