Setting connection timeout

Top  Previous  Next

You can use the Sftp.Timeout property 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 exception.

 

Example

 

[C#]

 

// set connection timeout to 5 seconds

sftp.Timeout = 5000;

 

[VB]

 

' set connection timeout to 5 seconds

sftp.Timeout = 5000