Skip to content

Commit

Permalink
use recv instead of recv_from
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-goldenring committed Aug 17, 2021
1 parent e6b5c72 commit 65b8f03
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions discovery-handlers/onvif/src/discovery_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ pub mod util {

async fn try_recv_string(s: &mut UdpSocket, timeout: Duration) -> std::io::Result<String> {
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())
}

Expand Down

0 comments on commit 65b8f03

Please sign in to comment.