sshnet / sshnet/SSH.NET

SSH Client Stream - No notification of remote closed

Open
#507 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

We have a use case where we need to open an SSH client to a remote host and communicate as a stream - i.e. it's not a command/response.

This works fine with CreateShellStream() and the DataReceived event handles incoming unsolicited data.

However, we're seeing the remote end is sometimes closed (gracefully - we see the FIN/ACK in wireshark), but our local end doesn't get any notification event raised. At worst I was hoping we'd get an ErrorOccured event on either the client or the stream, but nope.

The first we find out is a call to IsConnected returning false - and polling isn't cool.

Is this a deficiency of the library or am I doing something wrong. I'd read the docs... if there were any ;)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing CreateShellStream and the existing DataReceived, ErrorOccured, and IsConnected behavior around a graceful remote close. Confirm how the SSH client and stream handle the FIN/ACK case, then define a notification that reliably exposes the closure and add coverage for that scenario; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.