sshnet / sshnet/SSH.NET

Is it a better practice to actively close the socket when the forwarded-tcpip channel receives an EOF?

Open
#1,754 2 comments 0 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

My server program uses this library to perform remote port forwarding with an SSH forwarding server. The client connects to the server through the SSH forwarding server. I need to close the session between the client and the server when the client actively closes the socket. Currently, the library only closes after a timeout. When I modify ChannelForwardedTcpip to add EndOfData handling, I can achieve the desired effect, as shown in the diagram. Could this modification cause any problems? For example: frequent creation and destruction of channels affecting performance? Resources not being properly released? Data not being fully transmitted before closing?
Image

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 inspecting ChannelForwardedTcpip and its EndOfData handling, then reproduce a forwarded-tcpip connection where the client actively closes its socket. Verify whether the session closes promptly without losing transmitted data, leaking resources, or causing problematic channel churn.

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
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.