Add check for closed connection to read_ready()

This commit is contained in:
trepidacious 2024-06-30 17:47:04 +01:00
parent bd0243d12f
commit c3be54f96b

View File

@ -587,7 +587,7 @@ mod embedded_io_impls {
impl<'d> embedded_io_async::ReadReady for TcpSocket<'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()))
}
}