public class ServicePointManager
|
When an application requests a connection to an Internet resource URI through the ServicePointManager, the ServicePointManager returns a ServicePoint instance containing connection information for the host identified by the URI. If there is an existing ServicePoint for that host, the ServicePointManager returns the existing ServicePoint, otherwise the ServicePointManager creates a new ServicePoint instance.
Uri myUri = new Uri("http://www.contoso.com/"); ServicePoint mySP = ServicePointManager.FindServicePoint(myUri);
DefaultNonPersistentConnectionLimit | The default number of nonpersistent connections (4) allowed on a ServicePoint connected to an HTTP/1.0 or later server. This field is constant. |
DefaultPersistentConnectionLimit | The default number of persistent connections (2) allowed on a ServicePoint connected to an HTTP/1.1 or later server. This field is constant. |
DefaultConnectionLimit | Read-write The maximum number of concurrent connections allowed by a ServicePoint instance. |
MaxServicePointIdleTime | Read-write Gets or sets the maximum idle time of a ServicePoint instance. |
MaxServicePoints | Read-write Gets or sets the maximum number of ServicePoint instances to maintain at any time. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
FindServicePoint | Overloaded:FindServicePoint(Uri address) Finds an existing ServicePoint or creates a new ServicePoint to manage communications with the specified Uri. |
FindServicePoint | Overloaded:FindServicePoint(string uriString, IWebProxy proxy) Finds an existing ServicePoint or creates a new ServicePoint to manage communications with the specified URI. |
FindServicePoint | Overloaded:FindServicePoint(Uri address, IWebProxy proxy) Finds an existing ServicePoint or creates a new ServicePoint to manage communications with the specified Uri instance. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public const int DefaultNonPersistentConnectionLimit;
|
public const int DefaultPersistentConnectionLimit;
|
public static int DefaultConnectionLimit {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | ServicePointManager.DefaultConnectionLimit is less than zero. |
Changing the ServicePointManager.DefaultConnectionLimit property has no effect on existing ServicePoint instances; it affects only ServicePoint instances that are initialized after the change.
public static int MaxServicePointIdleTime {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | ServicePointManager.MaxServicePointIdleTime is less than -2 or greater than Int32.MaxValue |
After a ServicePoint has been idle for the time specified in ServicePoint.MaxIdleTime, it is eligible for garbage collection. A ServicePoint is idle when the list of connections associated with the ServicePoint is empty.
Default value is 900,000 milliseconds (15 minutes).
public static int MaxServicePoints {get; set;}
|
~ServicePointManager(); |
public static ServicePoint FindServicePoint( |
address
Exception Type | Condition |
---|---|
ArgumentNullException | address is null. |
InvalidOperationException | The maximum number of service points defined in ServicePointManager.MaxServicePoints has been reached. |
public static ServicePoint FindServicePoint( |
uriString
proxy
Exception Type | Condition |
---|---|
UriFormatException | The URI specified in uriString is invalid. |
InvalidOperationException | The maximum number of service points defined in ServicePointManager.MaxServicePoints has been reached. |
public static ServicePoint FindServicePoint( |
address
proxy
Exception Type | Condition |
---|---|
ArgumentNullException | address is null. |
InvalidOperationException | The maximum number of service points defined in ServicePointManager.MaxServicePoints has been reached. |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public virtual string ToString(); |