Skip to main content

accept

Function accept 

Source
pub async fn accept(
    listener: &TcpListener,
) -> Result<(TcpStream, SocketAddr), Error>
Expand description

Accepts one connection, for a caller driving the accept loop itself.

Exposed so the CLI owns the loop — and therefore owns Ctrl-C, the progress output, and the decision to keep serving after one connection fails. A forwarder that owned its own loop would have to grow a callback for each of those.