-
-
Notifications
You must be signed in to change notification settings - Fork 968
Open
Description
Hi, I am trying to use this stream example:
{
client.Connect();
// Make the server echo back the input file with "cat"
using (SshCommand command = client.CreateCommand("cat"))
{
Task executeTask = command.ExecuteAsync(CancellationToken.None);
using (Stream inputStream = command.CreateInputStream())
{
inputStream.Write("Hello World!"u8);
}
await executeTask;
Console.WriteLine(command.ExitStatus); // 0
Console.WriteLine(command.Result); // "Hello World!"
}
}
However, I am having issues with it. Frequently, the data doesn't reach the client. So, instead of "Hello World!" the result is empty.
I am trying to use it to write several lines of input via SSH. My client is already connected before I call this.
I tried forcing inputStream.Flush() but it doesn't work reliably and might not make any difference.
How can I fix this? Is there another approach to consider?
Metadata
Metadata
Assignees
Labels
No labels