mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Update ReadReady
and WriteReady
implementations
Update `ReadReady` for `TcpReader` to match implementation for `TcpSocket` Update `WriteReady` implementations to use `can_recv()` rather than `may_recv()`, since this will check that the transmit buffer is not full.
This commit is contained in:
parent
92eb6011d6
commit
abe7f9921e
@ -603,7 +603,7 @@ mod embedded_io_impls {
|
||||
|
||||
impl<'d> embedded_io_async::WriteReady for TcpSocket<'d> {
|
||||
fn write_ready(&mut self) -> Result<bool, Self::Error> {
|
||||
Ok(self.io.with(|s, _| s.may_send()))
|
||||
Ok(self.io.with(|s, _| s.can_send()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -619,7 +619,7 @@ mod embedded_io_impls {
|
||||
|
||||
impl<'d> embedded_io_async::ReadReady for TcpReader<'d> {
|
||||
fn read_ready(&mut self) -> Result<bool, Self::Error> {
|
||||
Ok(self.io.with(|s, _| s.can_recv()))
|
||||
Ok(self.io.with(|s, _| s.can_recv() || !s.may_recv()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -639,7 +639,7 @@ mod embedded_io_impls {
|
||||
|
||||
impl<'d> embedded_io_async::WriteReady for TcpWriter<'d> {
|
||||
fn write_ready(&mut self) -> Result<bool, Self::Error> {
|
||||
Ok(self.io.with(|s, _| s.may_send()))
|
||||
Ok(self.io.with(|s, _| s.can_send()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user