次の方法で共有


ServicePointManager クラス

定義

注意事項

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.

ServicePoint オブジェクトのコレクションを管理します。

public ref class ServicePointManager
public class ServicePointManager
[System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public class ServicePointManager
type ServicePointManager = class
[<System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type ServicePointManager = class
Public Class ServicePointManager
継承
ServicePointManager
属性

次のコード例では、URI www.contoso.comに接続するための ServicePoint オブジェクトを作成します。

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)

注釈

ServicePointManager は、ServicePoint クラスのインスタンスを作成、維持、および削除するために使用される静的クラスです。

アプリケーションが、ServicePointManager オブジェクトを介してインターネット リソース Uniform Resource Identifier (URI) への接続を要求すると、ServicePointManager は、URI によって識別されるホストとスキームの接続情報を含む ServicePoint オブジェクトを返します。 そのホストとスキームの既存の ServicePoint オブジェクトがある場合、ServicePointManager オブジェクトは既存の ServicePoint オブジェクトを返します。それ以外の場合、ServicePointManager オブジェクトは新しい ServicePoint オブジェクトを作成します。

.NET Framework 4.6 には、接続の安全でない暗号アルゴリズムとハッシュ アルゴリズムをブロックする新しいセキュリティ機能が含まれています。 HttpClientHttpWebRequestFtpWebRequestSmtpClientSslStreamなどの API を介して TLS/SSL を使用し、.NET Framework 4.6 を対象とするアプリケーションでは、既定でより安全な動作が得られます。

開発者は、既存の SSL3 サービスまたは TLS と RC4 サービスとの相互運用性を維持するために、この動作をオプトアウトすることができます。 この記事、新しい動作が無効になるようにコードを変更する方法について説明します。

大事な

新しい開発には、ServicePointManager クラスを使用しないことをお勧めします。 代わりに、System.Net.Http.HttpClient クラスを使用します。

フィールド

DefaultNonPersistentConnectionLimit
古い.

HTTP/1.0 以降のサーバーに接続されている ServicePoint オブジェクトで許可される非永続的接続の既定の数 (4)。 このフィールドは定数ですが、.NET Framework 2.0 以降では使用されません。

DefaultPersistentConnectionLimit
古い.

HTTP/1.1 以降のサーバーに接続された ServicePoint オブジェクトで許可される既定の永続接続数 (2)。 このフィールドは定数であり、DefaultConnectionLimit プロパティの値が直接または構成によって設定されていない場合に、DefaultConnectionLimit プロパティを初期化するために使用されます。

プロパティ

CertificatePolicy
古い.

サーバー証明書のポリシーを取得または設定します。

CheckCertificateRevocationList
古い.

証明書が証明機関失効リストに対してチェックされるかどうかを示す Boolean 値を取得または設定します。

DefaultConnectionLimit
古い.

ServicePoint オブジェクトで許可される同時接続の最大数を取得または設定します。

DnsRefreshTimeout
古い.

ドメイン ネーム サービス (DNS) 解決が有効と見なされる期間を示す値を取得または設定します。

EnableDnsRoundRobin
古い.

ドメイン ネーム サービス (DNS) 解決が該当するインターネット プロトコル (IP) アドレス間でローテーションされるかどうかを示す値を取得または設定します。

EncryptionPolicy
古い.

この ServicePointManager インスタンスの EncryptionPolicy を取得します。

Expect100Continue
古い.

100-Continue 動作を使用するかどうかを決定する Boolean 値を取得または設定します。

MaxServicePointIdleTime
古い.

ServicePoint オブジェクトの最大アイドル時間を取得または設定します。

MaxServicePoints
古い.

いつでも保持する ServicePoint オブジェクトの最大数を取得または設定します。

ReusePort
古い.

このプロパティ値を true に設定すると、HttpWebRequest からのすべての送信 TCP 接続で、ソケットでSO_REUSE_UNICASTPORTネイティブ ソケット オプションが使用されます。 これにより、基になる送信ポートが共有されます。 これは、多数の発信接続が短時間で行われ、アプリがポートを使い切るリスクがあるシナリオに役立ちます。

SecurityProtocol
古い.

ServicePointManager オブジェクトによって管理される ServicePoint オブジェクトによって使用されるセキュリティ プロトコルを取得または設定します。

ServerCertificateValidationCallback
古い.

サーバー証明書を検証するコールバックを取得または設定します。

UseNagleAlgorithm
古い.

Nagle アルゴリズムが、この ServicePointManager オブジェクトによって管理されるサービス ポイントによって使用されるかどうかを判断します。

メソッド

Equals(Object)
古い.

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FindServicePoint(String, IWebProxy)
古い.

既存の ServicePoint オブジェクトを検索するか、新しい ServicePoint オブジェクトを作成して、指定した Uniform Resource Identifier (URI) との通信を管理します。

FindServicePoint(Uri)
古い.

既存の ServicePoint オブジェクトを検索するか、指定した Uri オブジェクトとの通信を管理する新しい ServicePoint オブジェクトを作成します。

FindServicePoint(Uri, IWebProxy)
古い.

既存の ServicePoint オブジェクトを検索するか、指定した Uri オブジェクトとの通信を管理する新しい ServicePoint オブジェクトを作成します。

GetHashCode()
古い.

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()
古い.

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()
古い.

現在の Objectの簡易コピーを作成します。

(継承元 Object)
SetTcpKeepAlive(Boolean, Int32, Int32)
古い.

TCP 接続のキープアライブ オプションを有効または無効にします。

ToString()
古い.

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください