Skip to main content

serve

Function serve 

Source
pub async fn serve<L, C, D>(
    listener: L,
    codec: Arc<C>,
    dispatch: Arc<D>,
    config: SessionConfig,
)
where L: Listener, C: EnvelopeCodec + 'static, D: Dispatch + 'static + ?Sized,
Expand description

Accept connections from listener and serve each with run_session, bounded by SessionLimits::max_connections. The accept loop and all per-connection futures share one FuturesUnordered — spawn-free.