Archived Forum Post

Index of archived forum posts

Question:

SSHTunnel authentication test and idle disconnection

Nov 05 '12 at 08:31

Hi,

i have an application written in C# that open SSHTunnel,

  1. after calling BeginAccepting(), a new background thread opened, but with no active SSH Session, if no one will connect to the Listening port i have no idea if the ssh authentication is OK or not, is there a way to know ? maybe call a test first connection ?

  2. the SSHTunnel disconnect after a few second of idle time, is there a way to control this time ?

Thanks


Answer

1) Given that it's a background thread that is waiting for incoming connections, your application's foreground thread is free to make a connection. Simply have your foreground thread connect to localhost:<port> where <port> is the listen port (i.e. the port number passed to BeginAccepting).

2) No, because the client-side (Chilkat) is not the side of the connection that disconnects after some amount of inactivity. It is the SSH server-side that makes this decision, and there is no way to modify this aspect of the server's behavior.