ServicePointManager.DefaultConnectionLimit プロパティ

定義

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

public:
 static property int DefaultConnectionLimit { int get(); void set(int value); };
public static int DefaultConnectionLimit { get; set; }
static member DefaultConnectionLimit : int with get, set
Public Shared Property DefaultConnectionLimit As Integer

プロパティ値

ServicePoint オブジェクトで許可されているコンカレント接続の最大数。 既定の接続制限は、ASP.NET ホストされているアプリケーションの場合は 10、それ以外の場合は 2 です。 アプリが ASP.NET ホストとして実行されている場合、autoConfig プロパティが trueに設定されていると、構成ファイルからこのプロパティの値を変更することはできません。 ただし、autoConfig プロパティが trueであれば、プログラムで値を変更できます。 AppDomain の読み込み時に、目的の値を 1 回だけ設定します。

例外

次のコード例では、このプロパティを設定します。

ServicePointManager::UseNagleAlgorithm = true;
ServicePointManager::Expect100Continue = true;
ServicePointManager::CheckCertificateRevocationList = true;
ServicePointManager::DefaultConnectionLimit = ServicePointManager::DefaultPersistentConnectionLimit;
ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _
    ServicePointManager.DefaultPersistentConnectionLimit

注釈

プロパティは DefaultConnectionLimit 、オブジェクトの作成時にオブジェクトが プロパティに ServicePointManager 割り当てる同時実行接続の既定の ConnectionLimit 最大数を ServicePoint 設定します。

プロパティを変更しても、既存ServicePointDefaultConnectionLimitオブジェクトには影響しません。変更後に初期化されたオブジェクトにのみServicePoint影響します。 このプロパティの値が直接または構成によって設定されていない場合、値の既定値は 定数 DefaultPersistentConnectionLimitになります。

Note

プロパティに対する変更は DefaultConnectionLimit 、HTTP 1.0 接続と HTTP 1.1 接続の両方に影響します。 HTTP 1.0 プロトコルと HTTP 1.1 プロトコルの接続制限を個別に変更することはできません。

適用対象

こちらもご覧ください