Merge pull request #165 from sopium/fix-udp-recv

Fix Async::<UdpSocket>::recv
This commit is contained in:
Stjepan Glavina 2020-06-14 14:49:49 +02:00 committed by GitHub
commit 68e97d76a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -852,7 +852,7 @@ impl Async<UdpSocket> {
/// # std::io::Result::Ok(()) });
/// ```
pub async fn recv(&self, buf: &mut [u8]) -> io::Result<usize> {
self.write_with(|io| io.recv(buf)).await
self.read_with(|io| io.recv(buf)).await
}
/// Receives a single datagram message from the connected peer without removing it from the