Skip to main content

serve

Function serve 

Source
pub async fn serve<S, H>(
    scheduler: &S,
    listener: S::Socket,
    handler: &H,
    options: &Options,
    cancellation: &Cancellation,
) -> Result<Statistics, Error>
Expand description

Serve an already-bound listener with bounded concurrent connection futures. No hidden tasks or detached jobs are created. Cancellation stops acceptance, cancels active exchanges, joins retirement, and closes the owned listener. Individual peer/handler failures are counted without stopping other peers.