Interface IMultiplexedStream
- Namespace
- IceRpc.Transports
- Assembly
- IceRpc.dll
A multiplexed stream enables byte data exchange over a multiplexed transport.
public interface IMultiplexedStream : IDuplexPipe
- Inherited Members
Remarks
A bidirectional stream provides both Input and Output, while a unidirectional stream provides only an input (remote stream) or an output (local stream); getting the other one throws InvalidOperationException. The implementation of the output must be a ReadOnlySequencePipeWriter that supports reporting its count of unflushed bytes.
The owner of this stream must always complete the input and output. Until then, the stream can hold onto transport resources and count against the connection's stream limits. Closing or disposing the connection fails the pending and future read and write operations of the stream and completes WritesClosed.
Properties
Id
Gets the stream ID.
ulong Id { get; }
Property Value
- ulong
The stream ID.
Remarks
The stream IDs have the same format as the QUIC stream IDs https://datatracker.ietf.org/doc/html/rfc9000#name-stream-types-and-identifier.
Exceptions
- InvalidOperationException
Thrown when the stream is not started. A remote stream is always started; depending on the transport implementation, a local stream is started at construction or by the first write.
IsBidirectional
Gets a value indicating whether the stream is bidirectional.
bool IsBidirectional { get; }
Property Value
IsRemote
Gets a value indicating whether the stream is remote. A remote stream is a stream initiated by the peer and it's returned by AcceptStreamAsync(CancellationToken).
bool IsRemote { get; }
Property Value
IsStarted
Gets a value indicating whether the stream is started.
bool IsStarted { get; }
Property Value
Remarks
Remote streams are always started after construction. Depending on the transport implementation, a local stream is started at construction or by the first write.
WritesClosed
Gets a task that completes when all write network activity ceases for this stream. This occurs when:
<ul><li><xref href="System.IO.Pipelines.PipeWriter.Complete(System.Exception)" data-throw-if-not-resolved="false"></xref> is called on this stream's <xref href="System.IO.Pipelines.IDuplexPipe.Output" data-throw-if-not-resolved="false"></xref>.</li><li>the peer calls <xref href="System.IO.Pipelines.PipeReader.Complete(System.Exception)" data-throw-if-not-resolved="false"></xref> on the stream's <xref href="System.IO.Pipelines.IDuplexPipe.Input" data-throw-if-not-resolved="false"></xref>.</li><li>the implementation detects a network failure that prevents further writes on the underlying
network stream.</li></ul>
The task is never faulted or canceled.
Task WritesClosed { get; }
Property Value
- Task
The writes closed task.