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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SshSessionChannel(transport: SshTransportConnection, options?: SshSessionChannelOptions): SshSessionChannel;Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:97
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
transport | SshTransportConnection |
options | SshSessionChannelOptions |
Returns
Section titled “Returns”SshSessionChannel
Methods
Section titled “Methods”close()
Section titled “close()”close(): void;Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:279
Sends EOF and CLOSE. Should be called when the client is done sending.
Returns
Section titled “Returns”void
dispatch()
Section titled “dispatch()”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
payload | Buffer |
Returns
Section titled “Returns”void
dispatchError()
Section titled “dispatchError()”dispatchError(error: Error): void;Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:340
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error | Error |
Returns
Section titled “Returns”void
openExec()
Section titled “openExec()”openExec(command: string): Promise<void>;Defined in: src/protocols/ssh/connection/SshSessionChannel.ts:118
Opens the channel and executes a command.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
command | string |
Returns
Section titled “Returns”Promise<void>
openSubsystem()
Section titled “openSubsystem()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
subsystemName | string |
Returns
Section titled “Returns”Promise<void>
receiveData()
Section titled “receiveData()”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.
Returns
Section titled “Returns”AsyncGenerator<Buffer<ArrayBufferLike>, void, undefined>
sendData()
Section titled “sendData()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | Uint8Array |
Returns
Section titled “Returns”Promise<void>