I am using SSH.NET to create a reverse tunnel to a Linux server so that I am able to connect to a VNC server behind a NAT. There is also a monitoring program running that checks whether someone is actually connected to the VNC server. This is checked using the following piece of code:
(monitorPort is 5900, so the port VNC server is listening on)
Using our old reverse tunneling system, this worked fine. But with SSH.NET the amount of clients never decrease. It seems that SSH.NET keeps the socket to the VNC server open forever.
I can clearly see that when I connect to the VNC server through the tunnel, the amount of clients goes to 1, but when I disconnect the VNC client it never goes back to 0.
When I connect directly to the VNC server (over LAN, not through the tunnel) the amount of clients does immediately go back to 0 after disconnecting.
And when I use Plink for the reverse tunnel, the socket also closes immediately after a disconnect from the VNC client.
So I would say that this is a bug in SSH.NET right? The expected behavior would be that the socket closes immediately after the client disconnects.
If you need more info, please let me know. Will have a look at the source code myself tomorrow.
Kind regards,
LJ
I am using SSH.NET to create a reverse tunnel to a Linux server so that I am able to connect to a VNC server behind a NAT. There is also a monitoring program running that checks whether someone is actually connected to the VNC server. This is checked using the following piece of code:
(monitorPort is 5900, so the port VNC server is listening on)
Using our old reverse tunneling system, this worked fine. But with SSH.NET the amount of clients never decrease. It seems that SSH.NET keeps the socket to the VNC server open forever.
So I would say that this is a bug in SSH.NET right? The expected behavior would be that the socket closes immediately after the client disconnects.
If you need more info, please let me know. Will have a look at the source code myself tomorrow. Kind regards, LJ