Contents

inboundStreams(prepending:_:)

Handle inbound streams and provide a closure on which callback handlers will be executed. When the NetworkConnection<QUIC> state moves to ready, the internal listener is registered with the system and can receive incoming streams on the multiplexing instance. inboundStreams should only be called once on a NetworkConnection<QUIC>, and multiple calls to run will throw an exception.

Declaration

final func inboundStreams<NewApplicationProtocol>(@ProtocolStackBuilder<NewApplicationProtocol> prepending: @escaping (QUICStream) -> NewApplicationProtocol, _ handler: @escaping @isolated(any) @Sendable (QUIC.Stream<NewApplicationProtocol>) async throws -> Void) async throws where NewApplicationProtocol : OneToOneProtocol

Discussion

If the NetworkConnection<QUIC> is not started at the time that inboundStreams is invoked, it will be started.

The passed protocols in the prepending ProtocolStackBuilder will be added on top of the inbound streams.

The closure inherits the isolation domain of the caller.