Function accept

Source
pub fn accept(listener: &mut TcpListener) -> AcceptFuture<'_> 
Expand description

Returns an AcceptFuture, which is an async TcpListener::accept call.

Examples found in repository?
examples/tcp.rs (line 24)
19async fn go(addr: (&str, u16)) {
20    let mut listener = TcpListener::bind(addr).unwrap();
21    loop {
22        get_current_runtime()
23            .await
24            .push(handle(accept(&mut listener).await.unwrap()));
25    }
26}