Table of Contents

Method FromStream

Namespace
SshSharp
Assembly
SshSharp.dll

FromStream(Stream)

Input read from stream, from its current position to its end, while the command runs: a large file is sent without being held in memory. The stream stays open (the caller disposes it), and since it is read once, this input is for one command.

public static SshCommandInput FromStream(Stream stream)

Parameters

stream Stream

A readable stream.

Returns

SshCommandInput

Remarks

When the command ends before the stream is read to its end, the read in progress is cancelled. A stream whose ReadAsync ignores cancellation (some pipes and network streams) is not waited for: RunCommandAsync returns, and that one read may still complete, or fail, afterwards. What it returns is discarded, and an error it throws is not reported.