pub fn listen(
    addr: &SocketAddr,
) -> Result<impl Stream<Item = TcpStream, Error = tokio::io::Error>, tokio::io::Error> {
    let listener = TcpListener::bind(&addr)?;
    let stream = listener.incoming().and_then(|sock| {
        sock.set_nodelay(true)?;
        Ok(sock)
    });
    Ok(stream)
}
/// Sets up a listening TCP socket bound to the given address.
/// If successful, returns an asynchronous stream of `TcpStream` socket
/// objects representing accepted TCP connections from clients.
/// The TCP_NODELAY option is disabled on the returned sockets as
/// necessary for the HTTP/2 protocol.
Sets up a listening TCP socket bound to the given address.
If successful, returns an asynchronous stream of `TcpStream` socket
objects representing accepted TCP connections from clients.
The TCP_NODELAY option is disabled on the returned sockets as
necessary for the HTTP/2 protocol.
Sets up a listening TCP socket bound to the given address . If successful returns an asynchronous stream of ` TcpStream ` socket objects representing accepted TCP connections from clients . The TCP_NODELAY option is disabled on the returned sockets as necessary for the HTTP / 2 protocol .
pub fn listen(
    addr: &SocketAddr,
) -> Result<impl Stream<Item = TcpStream, Error = tokio::io::Error>, tokio::io::Error> {
    let listener = TcpListener::bind(&addr)?;
    let stream = listener.incoming().and_then(|sock| {
        sock.set_nodelay(true)?;
        Ok(sock)
    });
    Ok(stream)
}
pub fn listen ( addr : & SocketAddr , ) -> Result < impl Stream < Item = TcpStream , Error = tokio :: io :: Error > , tokio :: io :: Error > { let listener = TcpListener :: bind ( & addr ) ? ; let stream = listener . incoming ( ) . and_then ( | sock | { sock . set_nodelay ( true ) ? ; Ok ( sock ) } ) ; Ok ( stream ) }
Sets up a listening TCP socket bound to the given address.
Sets up a listening TCP socket bound to the given address .
addr
&SocketAddr
addr
&SocketAddr