The IdleTime property returns the server-side idle
timeout value that was most recently set for the control connection.
This value represents how long the server will wait during periods of
inactivity before automatically closing the connection. If the idle
timeout has not been explicitly set during the session, the property
will return the default timeout value of 300 seconds (5 minutes). If
this property is assigned a value less than 30 seconds or greater than
7200 seconds, it will be automatically adjusted to fit within the
valid range.
Setting this property changes the idle timeout period for the
control connection, which can be useful in scenarios where a file
transfer session is expected to remain idle for extended periods
between commands. For example, when transferring large batches of
files or performing periodic synchronization, the server may
automatically close the connection if no activity is detected
within its default timeout period. Increasing the idle timeout
helps prevent unexpected disconnects during these idle periods,
reducing the need to repeatedly reconnect and re-authenticate.
Conversely, reducing the timeout can be used to enforce shorter
sessions in security-sensitive environments.
The idle timeout value is only available if the server supports
the non-standard SITE IDLE command. If the server does
not support this command, this value is ignored and default timeout
enforced by the server will apply. This value is also ignored if
the session is using SFTP, as that protocol does not separate
control and data channels and does not support idle timeout settings
in the same way. If an invalid timeout period is specified (for
example, a negative number), an exception will be thrown.