KeepAlive Property  
 

Set or return if the connection to the server is persistent

Syntax

object.KeepAlive [= { True | False } ]

Remarks

Setting the KeepAlive property to a value of true indicates that the client wishes to maintain a persistent connection with the server. For those clients who wish to retrieve a number of documents, this is more efficient because the client does not need to connect, retrieve the document and disconnect each time. Instead, the client can connect, retrieve each document and then disconnect when it is finished. If the property value is False, a persistent connection is not maintained, and the client must establish a connection for each document that it wishes to retrieve. This property should be set to the desired value before establishing a connection with the server.

Note that this option is only available for those servers which support version 1.0 or later of the HTTP protocol. For version 1.0 servers, the connection header field is set to the value 'keep-alive', which instructs compliant servers to maintain a persistent connection. For version 1.1 and later, persistent connections are the default. In this case, if the property value is set to False, the connection header field will be set to the value 'close', telling the server that you wish to close the connection after the document has been retrieved. It is possible that the server may choose to close the connection itself, even if it supports persistent connections. If the server does not support persistent connections and the KeepAlive property is set to True, the control will attempt to simulate them by automatically reconnecting for each request.

Data Type

Boolean

See Also

ProtocolVersion Property, Connect Method, GetFile Method