From 65b8f033a65b79d6827db60eb9d89b68bc45d467 Mon Sep 17 00:00:00 2001 From: Kate Goldenring Date: Tue, 17 Aug 2021 12:06:27 -0700 Subject: [PATCH] use recv instead of recv_from --- discovery-handlers/onvif/src/discovery_impl.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/discovery-handlers/onvif/src/discovery_impl.rs b/discovery-handlers/onvif/src/discovery_impl.rs index 1d850ab06..550ab50c4 100644 --- a/discovery-handlers/onvif/src/discovery_impl.rs +++ b/discovery-handlers/onvif/src/discovery_impl.rs @@ -359,8 +359,7 @@ pub mod util { async fn try_recv_string(s: &mut UdpSocket, timeout: Duration) -> std::io::Result { let mut buf = vec![0; 16 * 1024]; - // TODO: use `try_recv_from` when update tokio - let (len, _src) = time::timeout(timeout, s.recv_from(&mut buf)).await??; + let len = time::timeout(timeout, s.recv(&mut buf)).await??; Ok(String::from_utf8_lossy(&buf[..len]).to_string()) }