Skip to content

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

Closed
@rsanchezre

Description

@rsanchezre

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions