mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
return NotReady when recv_from wouldblock in uds (#452)
This commit is contained in:
parent
f98b81e527
commit
e6fc3d209d
@ -104,6 +104,7 @@ impl UnixDatagram {
|
||||
let r = self.io.get_ref().recv_from(buf);
|
||||
if is_wouldblock(&r) {
|
||||
self.io.clear_read_ready(Ready::readable())?;
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
r.map(Async::Ready)
|
||||
}
|
||||
@ -118,6 +119,7 @@ impl UnixDatagram {
|
||||
let r = self.io.get_ref().recv(buf);
|
||||
if is_wouldblock(&r) {
|
||||
self.io.clear_read_ready(Ready::readable())?;
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
r.map(Async::Ready)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user