Skip to main content

serve_http_until

Function serve_http_until 

Source
async fn serve_http_until<C>(
    listener: TcpListener,
    state: AppState<C>,
    shutdown: &ShutdownWatch,
) -> Result<(), DevError>
where C: ComputeBackend + Clone + Send + Sync + 'static,
Expand description

Serve HTTP on an already-bound listener until the listener fails or shutdown is signalled, then give outstanding requests a bounded drain before force-closing what is left.

Kernel WebSocket tunnels live for hours and never “finish”, so an unbounded graceful drain would hang exit forever; after HTTP_DRAIN_TIMEOUT the serve future is dropped, which closes the remaining connections.