KeepAlive Property  

Enable monitoring of the command channel to keep the client session active.


object.KeepAlive [= { True | False } ]


Setting the KeepAlive property to a value of true specifies that a background worker thread will be created to monitor the command channel and periodically send NOOP commands to the server if no commands have been sent recently. This can prevent the server from terminating the client connection during idle periods where no commands are being issued. However, it is important to keep in mind that many servers can be configured to also limit the total amount of time a client can be connected to the server, as well as the amount of time permitted between file transfers. If the server does not respond to the NOOP command, this option will be automatically disabled for the remainder of the client session.

It is recommended that you only enable this option if the connection to the server must be maintained for a relatively long period of time where there will be periods of inactivity. Never make the assumption that this option can prevent the server from terminating the connection. Most sites, particularly public FTP servers accessed over the Internet, have fairly restrictive policies designed to prevent clients from maintaining long-term connections. In most cases, if there are periods of time where your application will not be transferring files, it is more appropriate to disconnect from the server and then reconnect at a later point rather than attempting to hold the connection open.

The default value for this property is false.

Data Type


See Also

Connect Method, GetFile Method, PutFile Method