System.Net.ServicePoint Class

Provides connection management for HTTP connections.

See Also: ServicePoint Members

Syntax

public class ServicePoint

Remarks

The System.Net.ServicePoint class handles connections to an Internet resource based on the host information passed in the resource's Uniform Resource Identifier (URI). The initial connection to the resource determines the information that the System.Net.ServicePoint object maintains, which is then shared by all subsequent requests to that resource.

System.Net.ServicePoint objects are managed by the System.Net.ServicePointManager class and are created, if necessary, by the erload:System.Net.ServicePointManager.FindServicePoint method. System.Net.ServicePoint objects are never created directly but are always created and managed by the System.Net.ServicePointManager class. The maximum number of System.Net.ServicePoint objects that can be created is set by the ServicePointManager.MaxServicePoints property.

Each System.Net.ServicePoint object maintains its connection to an Internet resource until it has been idle longer than the time specified in the ServicePoint.MaxIdleTime property. When a System.Net.ServicePoint exceeds the ServicePoint.MaxIdleTime value, it can be recycled to another connection. The default value of ServicePoint.MaxIdleTime is set by the ServicePointManager.MaxServicePointIdleTime property.

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 it services the next request. This is useful for applications that do not require active connections that are opened indefinitely, as they are by default.

Note:

In high load conditions, some applications may run out of free threads in the ThreadPool, which may lead to poor system performance (such as high and variable transaction times). See tp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt17.asp for a number of configuration changes you can make to fix this issue.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

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