Show / Hide Table of Contents

Interface IStreamDemuxer

The IStreamDemuxer interface allows you to interact with processes running in a container in a Kubernetes pod. You can start an exec or attach command by calling WebSocketNamespacedPodExecAsync(string, string, IEnumerable<string>, string, bool, bool, bool, bool, string, Dictionary<string, List<string>>, CancellationToken) or WebSocketNamespacedPodAttachAsync(string, string, string, bool, bool, bool, bool, string, Dictionary<string, List<string>>, CancellationToken). These methods will return you a WebSocket connection.

Kubernetes 'multiplexes' multiple channels over this WebSocket connection, such as standard input, standard output and standard error. The StreamDemuxer allows you to extract individual Streams from this WebSocket. You can then use these streams to send/receive data from that process.

Inherited Members
IDisposable.Dispose()
Namespace: k8s
Assembly: KubernetesClient.dll
Syntax
public interface IStreamDemuxer : IDisposable

Methods

View Source

GetStream(byte?, byte?)

Gets a Stream which allows you to read to and/or write from a remote channel.

Declaration
Stream GetStream(byte? inputIndex, byte? outputIndex)
Parameters
Type Name Description
byte? inputIndex

The index of the channel from which to read.

byte? outputIndex

The index of the channel to which to write.

Returns
Type Description
Stream

A Stream which allows you to read/write to the requested channels.

View Source

GetStream(ChannelIndex?, ChannelIndex?)

Gets a Stream which allows you to read to and/or write from a remote channel.

Declaration
Stream GetStream(ChannelIndex? inputIndex, ChannelIndex? outputIndex)
Parameters
Type Name Description
ChannelIndex? inputIndex

The index of the channel from which to read.

ChannelIndex? outputIndex

The index of the channel to which to write.

Returns
Type Description
Stream

A Stream which allows you to read/write to the requested channels.

View Source

Start()

Starts reading the data sent by the server.

Declaration
void Start()
View Source

Write(byte, byte[], int, int, CancellationToken)

Directly writes data to a channel.

Declaration
Task Write(byte index, byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
byte index

The index of the channel to which to write.

byte[] buffer

The buffer from which to read data.

int offset

The offset at which to start reading.

int count

The number of bytes to read.

CancellationToken cancellationToken

A CancellationToken which can be used to cancel the asynchronous operation.

Returns
Type Description
Task

A Task which represents the asynchronous operation.

View Source

Write(ChannelIndex, byte[], int, int, CancellationToken)

Directly writes data to a channel.

Declaration
Task Write(ChannelIndex index, byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ChannelIndex index

The index of the channel to which to write.

byte[] buffer

The buffer from which to read data.

int offset

The offset at which to start reading.

int count

The number of bytes to read.

CancellationToken cancellationToken

A CancellationToken which can be used to cancel the asynchronous operation.

Returns
Type Description
Task

A Task which represents the asynchronous operation.

  • View Source
In this article
Back to top Generated by DocFX