From aa4b552e0fcb7599b03df25b7365fa11afc61709 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 6 Feb 2023 20:54:30 +0100 Subject: [PATCH] server recv --- kubi-udp/src/server.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kubi-udp/src/server.rs b/kubi-udp/src/server.rs index fce125d..fe78696 100644 --- a/kubi-udp/src/server.rs +++ b/kubi-udp/src/server.rs @@ -58,8 +58,14 @@ impl Server { } pub fn update(&mut self) { let mut buf = Vec::new(); - if self.socket.recv(&mut buf).is_ok() { - todo!() + loop { + if self.socket.recv(&mut buf).is_ok() { + todo!() + } else { + break + } + buf.clear() } + } }