From 11d59bed7484ada05de1ec5270263560fc5b70bd Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Mon, 13 May 2024 10:38:25 +0000 Subject: [PATCH] Use the simpler readable() call which works for ESP IDF too --- rs-matter/src/transport/network.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/rs-matter/src/transport/network.rs b/rs-matter/src/transport/network.rs index 757f8fb8..b5a28f0d 100644 --- a/rs-matter/src/transport/network.rs +++ b/rs-matter/src/transport/network.rs @@ -141,15 +141,7 @@ mod async_io { impl NetworkReceive for &Async { async fn wait_available(&mut self) -> Result<(), Error> { - let mut buf = [0]; - - loop { - let (len, _) = Async::::peek_from(self, &mut buf).await?; - - if len > 0 { - break; - } - } + Async::::readable(self).await?; Ok(()) }