SFTP: Work with timeouts
Computer networks are a fairly unstable method of communication. Implementing the network layer properly contributes towards the stability and improved user experience of your application. Handling network timeouts properly is one of the cornerstones of implementing a networking application.
TElSimpleSFTPClient offers a flexible approach to timeout handling suitable for the majority of environments.
SocketTimeout property sets a general length of timeout (in milliseconds) for all underlying socket operations, such as connect(), send() and recv(). This means that if a socket operation can't be completed in the specified time frame, the connection is considered broken. You are normally notified about that by an exception thrown from the higher-level method (e.g. Open(), DataAvailable() or ReceiveData()).
The default value for socket timeout is 60000 (60 seconds). You can set it to 0 to make the component wait for completion of any socket operations for indefinite period of time, yet in the majority of cases this can't be considered a good practice.
CommandTimeout is used in high-level ExecuteSSHCommand() calls to specify a maximum period of waiting for a remote command to return any data. This includes waiting caused by remote command execution delays (e.g. if the command hangs) and network issues. The default timeout value is 60000 (60 seconds).