johnyburd / net-route

Rust crate providing a cross platform interface for interacting with the routing table
https://docs.rs/net-route/
17 stars 12 forks source link

recv data would block #23

Closed Dawson-Jones closed 6 months ago

Dawson-Jones commented 6 months ago
use futures::StreamExt;
use net_route::Handle;

#[tokio::main]
async fn main() -> std::io::Result<()> {
    let handle = Handle::new()?;
    let stream = handle.route_listen_stream();

    futures::pin_mut!(stream);

    println!("Listening for route events, press Ctrl+C to cancel...");
    while let Some(value) = stream.next().await {
        println!("{:?}", value);
    }
    Ok(())
}

this is code from examples/listen.rs, It would block when you switch the wifi, this bug is 100% reproducible

johnyburd commented 6 months ago

fixed in #22, released in 0.4.2