Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renci.SshNet.Common.SshException - Time-Out #984

Closed
rsanchezre opened this issue Jul 27, 2022 · 4 comments
Closed

Renci.SshNet.Common.SshException - Time-Out #984

rsanchezre opened this issue Jul 27, 2022 · 4 comments
Milestone

Comments

@rsanchezre
Copy link

Hi,
I've been developing a APP in VB.net which main goal is to connect to several device (routers or switches), to get info or to set parameter in unmanaged way and masive. The core of the app is Renci.ssh dll and every connection is put into a new thread to parallelize them. It is working fine, but some times i have a managed exceptions "Renci.SshNet.Common.SshException" arised by "Time OUT". I have been capture traffic with wireshark and i could see ,in this momento, there exist conectivity betwen my app and the device, because they exchange packets, but something is wrong with the app because it not starte whit de "INIT" fase of ssh. Then the connection reach the time out set it in 60seg. and the excepcion arise.

I wonder to know if somebody could give me a clue to look into a fix.

Regards

Operating System (for Windows, run winver.exe): Windows 11 - 20H2 (19042.1706)

Project information

Visual Studio 2022 compilated for x64 whit net frame 4.8
Sample Code:

I'm put each connection in a multithreaded calling x times to this code.

Dim multiThread As Thread = New Thread(AddressOf EjecutarConexion)
multiThread.SetApartmentState(ApartmentState.MTA)
multiThread.Start(Apasar)

In Plain Text:

3 0.000000 10.0.91.163 192.168.35.7 TCP 14964 → 22 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM=1
4 0.018121 192.168.35.7 10.0.91.163 TCP 22 → 14964 [SYN, ACK] Seq=0 Ack=1 Win=4128 Len=0 MSS=536
5 0.000056 10.0.91.163 192.168.35.7 TCP 14964 → 22 [ACK] Seq=1 Ack=1 Win=65392 Len=0
6 0.000290 10.0.91.163 192.168.35.7 SSHv2 Client: Protocol (SSH-2.0-Renci.SshNet.SshClient.0.0.1)
7 0.017920 192.168.35.7 10.0.91.163 TCP 22 → 14964 [ACK] Seq=1 Ack=39 Win=4090 Len=0
8 0.000099 192.168.35.7 10.0.91.163 SSHv2 Server: Protocol (SSH-2.0-Cisco-1.25)
9 0.042709 10.0.91.163 192.168.35.7 TCP 14964 → 22 [ACK] Seq=39 Ack=20 Win=65373 Len=0
10 59.952183 10.0.91.163 192.168.35.7 TCP 14964 → 22 [FIN, ACK] Seq=39 Ack=20 Win=65373 Len=0
11 0.019279 192.168.35.7 10.0.91.163 TCP 22 → 14964 [ACK] Seq=20 Ack=40 Win=4090 Len=0
12 0.099780 192.168.35.7 10.0.91.163 TCP 22 → 14964 [FIN, PSH, ACK] Seq=20 Ack=40 Win=4090 Len=0
13 0.000071 10.0.91.163 192.168.35.7 TCP 14964 → 22 [ACK] Seq=40 Ack=21 Win=65373 Len=0

The IP 10.0.91.163 is where the app is running. The ip 192.168.35.7 is the router's IP.

@rsanchezre rsanchezre changed the title SshException - Time-Out Renci.SshNet.Common.SshException - Time-Out Jul 27, 2022
@geoffstewart
Copy link

I think my PR #972 might solve this issue for you

@WojciechNagorski
Copy link
Collaborator

It's done in #1274

@WojciechNagorski WojciechNagorski added this to the 2023.0.1 milestone Dec 21, 2023
@rsanchezre
Copy link
Author

Hi WojciechNagorski, Thanks for your comment. I'm going to reading it.
Regards.

@WojciechNagorski
Copy link
Collaborator

The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants