mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
return NotReady when recv_from wouldblock in uds (#452)
This commit is contained in:
committed by
Carl Lerche
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user