Skip to content

StreamDuplexPipe

Wraps a bidirectional Stream as an IDuplexPipe. Suitable for TCP NetworkStream, named pipes, etc. The caller retains ownership of the Stream lifetime.

public sealed class StreamDuplexPipe : IDuplexPipe, IAsyncDisposable

Creates a duplex pipe backed by the specified stream.

public StreamDuplexPipe(Stream stream)

Completes the pipe reader and writer. Does not close the underlying stream.

public ValueTask DisposeAsync()

ValueTask

Gets the PipeReader half of the duplex pipe.

public PipeReader Input { get; }

PipeReader

Gets the PipeWriter half of the duplex pipe.

public PipeWriter Output { get; }

PipeWriter