Skip to content

SshSessionChannel

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:67

A single SSH session channel. Not safe to share across concurrent callers; each SftpSession should own one.

new SshSessionChannel(transport: SshTransportConnection, options?: SshSessionChannelOptions): SshSessionChannel;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:97

ParameterType
transportSshTransportConnection
optionsSshSessionChannelOptions

SshSessionChannel

close(): void;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:279

Sends EOF and CLOSE. Should be called when the client is done sending.

void


dispatch(payload: Buffer): void;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:292

Feed an inbound transport payload to this channel. Called by the channel multiplexer (SshConnectionManager).

ParameterType
payloadBuffer

void


dispatchError(error: Error): void;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:340

ParameterType
errorError

void


openExec(command: string): Promise<void>;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:118

Opens the channel and executes a command.

ParameterType
commandstring

Promise<void>


openSubsystem(subsystemName: string): Promise<void>;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:110

Opens the channel and requests a subsystem. Resolves once the server confirms both CHANNEL_OPEN and the subsystem request.

ParameterType
subsystemNamestring

Promise<void>


receiveData(): AsyncGenerator<Buffer<ArrayBufferLike>, void, undefined>;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:265

Async generator that yields raw data buffers from the channel. Returns (done) when the channel receives EOF or CLOSE.

AsyncGenerator<Buffer<ArrayBufferLike>, void, undefined>


sendData(data: Uint8Array): Promise<void>;

Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:218

Sends data on the channel. Respects the remote window; if there is no space, splits the data and queues the remainder for when WINDOW_ADJUST arrives.

Concurrent calls are serialized so wire byte order matches call order.

ParameterType
dataUint8Array

Promise<void>