ServicePointManager ServicePointManager ServicePointManager Class

Definition

Manages the collection of ServicePoint objects.

public ref class ServicePointManager
public class ServicePointManager
Public Class ServicePointManager
Inheritance
ServicePointManagerServicePointManagerServicePointManager

Examples

The following code example creates a ServicePoint object for connections to the URI www.contoso.com.

Uri^ myUri = gcnew Uri( "http://www.contoso.com/" );
ServicePoint^ mySP = ServicePointManager::FindServicePoint( myUri );
Uri myUri = new Uri("http://www.contoso.com/");
 
 ServicePoint mySP = ServicePointManager.FindServicePoint(myUri);
   
Dim myUri As New Uri("http://www.contoso.com/")
       
Dim mySP As ServicePoint = ServicePointManager.FindServicePoint(myUri)

Remarks

ServicePointManager is a static class used to create, maintain, and delete instances of the ServicePoint class.

When an application requests a connection to an Internet resource Uniform Resource Identifier (URI) through the ServicePointManager object, the ServicePointManager returns a ServicePoint object that contains connection information for the host and scheme identified by the URI. If there is an existing ServicePoint object for that host and scheme, the ServicePointManager object returns the existing ServicePoint object; otherwise, the ServicePointManager object creates a new ServicePoint object.

The .NET Framework 4.6 includes a new security feature that blocks insecure cipher and hashing algorithms for connections. Applications using TLS/SSL through APIs such as HttpClient, HttpWebRequest, FtpWebRequest, SmtpClient, SslStream, etc. and targeting .NET Framework 4.6 get the more-secure behavior by default.

Developers may want to opt out of this behavior in order to maintain interoperability with their existing SSL3 services or TLS w/ RC4 services. This article explains how to modify your code so that the new behavior is disabled.

Fields

DefaultNonPersistentConnectionLimit DefaultNonPersistentConnectionLimit DefaultNonPersistentConnectionLimit

The default number of non-persistent connections (4) allowed on a ServicePoint object connected to an HTTP/1.0 or later server. This field is constant but is no longer used in the .NET Framework 2.0.

DefaultPersistentConnectionLimit DefaultPersistentConnectionLimit DefaultPersistentConnectionLimit

The default number of persistent connections (2) allowed on a ServicePoint object connected to an HTTP/1.1 or later server. This field is constant and is used to initialize the DefaultConnectionLimit property if the value of the DefaultConnectionLimit property has not been set either directly or through configuration.

Properties

CertificatePolicy CertificatePolicy CertificatePolicy

Gets or sets policy for server certificates.

CheckCertificateRevocationList CheckCertificateRevocationList CheckCertificateRevocationList

Gets or sets a Boolean value that indicates whether the certificate is checked against the certificate authority revocation list.

ClientCipherSuitesCallback ClientCipherSuitesCallback ClientCipherSuitesCallback
DefaultConnectionLimit DefaultConnectionLimit DefaultConnectionLimit

Gets or sets the maximum number of concurrent connections allowed by a ServicePoint object.

DnsRefreshTimeout DnsRefreshTimeout DnsRefreshTimeout

Gets or sets a value that indicates how long a Domain Name Service (DNS) resolution is considered valid.

EnableDnsRoundRobin EnableDnsRoundRobin EnableDnsRoundRobin

Gets or sets a value that indicates whether a Domain Name Service (DNS) resolution rotates among the applicable Internet Protocol (IP) addresses.

EncryptionPolicy EncryptionPolicy EncryptionPolicy

Gets the EncryptionPolicy for this ServicePointManager instance.

Expect100Continue Expect100Continue Expect100Continue

Gets or sets a Boolean value that determines whether 100-Continue behavior is used.

MaxServicePointIdleTime MaxServicePointIdleTime MaxServicePointIdleTime

Gets or sets the maximum idle time of a ServicePoint object.

MaxServicePoints MaxServicePoints MaxServicePoints

Gets or sets the maximum number of ServicePoint objects to maintain at any time.

ReusePort ReusePort ReusePort

Setting this property value to true causes all outbound TCP connections from HttpWebRequest to use the native socket option SO_REUSE_UNICASTPORT on the socket. This causes the underlying outgoing ports to be shared. This is useful for scenarios where a large number of outgoing connections are made in a short time, and the app risks running out of ports.

SecurityProtocol SecurityProtocol SecurityProtocol

Gets or sets the security protocol used by the ServicePoint objects managed by the ServicePointManager object.

ServerCertificateValidationCallback ServerCertificateValidationCallback ServerCertificateValidationCallback

Gets or sets the callback to validate a server certificate.

ServerCipherSuitesCallback ServerCipherSuitesCallback ServerCipherSuitesCallback
UseNagleAlgorithm UseNagleAlgorithm UseNagleAlgorithm

Determines whether the Nagle algorithm is used by the service points managed by this ServicePointManager object.

Methods

Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindServicePoint(String, IWebProxy) FindServicePoint(String, IWebProxy) FindServicePoint(String, IWebProxy)

Finds an existing ServicePoint object or creates a new ServicePoint object to manage communications with the specified Uniform Resource Identifier (URI).

FindServicePoint(Uri) FindServicePoint(Uri) FindServicePoint(Uri)

Finds an existing ServicePoint object or creates a new ServicePoint object to manage communications with the specified Uri object.

FindServicePoint(Uri, IWebProxy) FindServicePoint(Uri, IWebProxy) FindServicePoint(Uri, IWebProxy)

Finds an existing ServicePoint object or creates a new ServicePoint object to manage communications with the specified Uri object.

GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetTcpKeepAlive(Boolean, Int32, Int32) SetTcpKeepAlive(Boolean, Int32, Int32) SetTcpKeepAlive(Boolean, Int32, Int32)

Enables or disables the keep-alive option on a TCP connection.

ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See Also