Skip to content

Commit

Permalink
Merge pull request project-chip#157 from ivmarkov/main
Browse files Browse the repository at this point in the history
Use the simpler readable() call which works for ESP IDF too
  • Loading branch information
andy31415 authored May 13, 2024
2 parents 8288ade + 11d59be commit 8449375
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions rs-matter/src/transport/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,7 @@ mod async_io {

impl NetworkReceive for &Async<UdpSocket> {
async fn wait_available(&mut self) -> Result<(), Error> {
let mut buf = [0];

loop {
let (len, _) = Async::<UdpSocket>::peek_from(self, &mut buf).await?;

if len > 0 {
break;
}
}
Async::<UdpSocket>::readable(self).await?;

Ok(())
}
Expand Down

0 comments on commit 8449375

Please sign in to comment.