Skip to content

Wrong commands sequence. ShellStream.WriteLine didn't flush buffer before send its data.  #180

Closed
@theanurin

Description

@theanurin
using (var sshStream = sshClient.CreateShellStream("C#", 80, 25, 100, 100, 1000))
{
    new MemoryStream(sshClient.ConnectionInfo.Encoding.GetBytes("echo 'command 1'\r")).CopyTo(sshStream);
    sshStream.WriteLine("echo 'command 2'");
    sshStream.Flush();
}

Expected result:
command 1
command 2

Current result:
command 2
command 1

My use case:
I open embedded resource (somescript.sh) as stream and want to send all content of the somescript.sh to sshStream...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions