Setting connection timeout |
You can use the Sftp#setTimeout method to define the maximum number of milliseconds to wait when establishing a connection to an SFTP server. Failure to establish a connection within the maximum time allowed will result in an SftpException thrown.
Example
// set connection timeout to 5 seconds sftp.setTimeout(5000); |