Skip to main content

serve_io

Function serve_io 

Source
pub async fn serve_io<IO>(
    io: IO,
    local_addr: SocketAddr,
    client_addr: SocketAddr,
    state: Arc<AppState>,
    is_tls: bool,
) -> Result<(), Box<dyn Error + Send + Sync>>
where IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Expand description

Serve a connection on any I/O type that implements AsyncRead + AsyncWrite + Unpin.

This is the generic entry point used by both plain TCP and TLS connections, as well as connections wrapped in a PrefixedStream (when PROXY protocol is enabled).