Contents

openStream(directionality:_:)

Initiate a new data stream over QUIC. When invoked with no parameters, the default stream type will be bidirectional. Unidirectional streams can be initiated by setting the optional bidirectional parameter to false.

Declaration

final func openStream<NewApplicationProtocol>(directionality: QUICStream.Directionality = .bidirectional, @ProtocolStackBuilder<NewApplicationProtocol> _ prepending: (QUICStream) -> NewApplicationProtocol) async throws -> QUIC.Stream<NewApplicationProtocol> where NewApplicationProtocol : OneToOneProtocol

Discussion

This call will start the underlying QUIC connection if it has not been started already and will block until the QUIC connection is ready.

The passed protocols in the prepending ProtocolStackBuilder will be added on top of the created QUIC Stream.

While streams can be cancelled independently of the underlying connection, if the parent NetworkChannel is cancelled or fails, the streams will as well.