How do I configure socket timeouts?

In Maverick Legacy Client 1.6.x socket time-outs are handled internally by the API (this was not the case in 1.4.x).

The default settings are for a socket time-out of 10 seconds, with the send ignore packet on idle setting set to true. This should ensure that any client experiencing a network outage will be disconnected timely. With this configuration the client will remain connected as long as the connection remains up.

You can change the timeout configurations using the methods below. Please see the comment for information as to what the method does

Ssh2Context ssh2 = (Ssh2Context)con.getContext(SshConnector.SSH2);
// Set timeout in milliseconds
ssh2.setSocketTimeout(30000);

// Set the idle timeout - if a client is idle for this amount of time it will be disconnected
ssh2.setIdleConnectionTimeoutSeconds(60000);

// Send an ignore packet on idle - this helps identify and disconnect during network outages
ssh2.setSendIgnorePacketOnIdle(true);
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.