Skip to content

SshCommand: OutputStream & ExtendedOutputStream should only return 0 when channel is closed #650

Closed

Description

@drieseng

Invoking Read(Byte[], Int32, Int32) on SshCommand*'s OutputStream or ExtendedOutputStream should blocking until either data is available, or the channel is closed (in which case zero should be returned).

We should strongly consider applying breaking changes to the SshCommand API as well:

  • Change signature of public string Execute() to public void Execute().
  • Have ExitCode throw when we have not received an ExitStatusRequestInfo.
  • Remove the Result property (users should use OutputStream instead).
  • Remove the Error property (users should use ExtendedOutputStream instead).

Activity

  1. added this to the 2020.1.0 milestone on Apr 5, 2020
  2. self-assigned this
    on Apr 5, 2020
  3. drieseng commented on Apr 5, 2020

    @drieseng
    MemberAuthor

    I've disabled the Ssh_Command_IntermittendOutput_OutputStream() integration test due to this issue.

  4. lucastheisen commented on Jun 23, 2020

    @lucastheisen

    It would be nice to simply be allowed to supply our own streams (like ProcessStartInfo for all in/out/err). Especially now that net core has System.IO.Pipelines. I think the internal PipeStream could probably be replaced altogether. It would certainly reduce the element of surprise...

  5. IgorMilavec commented on Mar 13, 2022

    @IgorMilavec
    Collaborator

    Just made a similar argument about API cleanup in #931... :)
    What if we also removed/deprecated the ExitCode property and return the exit code from Execute/ExecuteAsync?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions