System.Net.ServicePoint.ConnectionLeaseTimeout Property

Gets or sets the number of milliseconds after which an active System.Net.ServicePoint connection is closed.

Syntax

[System.MonoTODO]
public int ConnectionLeaseTimeout { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

You can use this property to ensure that a System.Net.ServicePoint object's active connections do not remain open indefinitely. This property is intended for scenarios where connections should be dropped and reestablished periodically, such as load balancing scenarios.

By default, when FtpWebRequest.KeepAlive is true for a request, the ServicePoint.MaxIdleTime property sets the time-out for closing System.Net.ServicePoint connections due to inactivity. If the System.Net.ServicePoint has active connections, ServicePoint.MaxIdleTime has no effect and the connections remain open indefinitely.

When the ServicePoint.ConnectionLeaseTimeout property is set to a value other than -1, and after the specified time elapses, an active System.Net.ServicePoint connection is closed after servicing a request by setting FtpWebRequest.KeepAlive to false in that request.

Setting this value affects all connections managed by the System.Net.ServicePoint object.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0