ServicePoint.ConnectionLimit プロパティ

定義

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

public:
 property int ConnectionLimit { int get(); void set(int value); };
public int ConnectionLimit { get; set; }
member this.ConnectionLimit : int with get, set
Public Property ConnectionLimit As Integer

プロパティ値

この ServicePoint オブジェクトで許可される接続の最大数。

例外

接続の制限は 0 以下です。

次のコード例では、ConnectionLimit プロパティを使用して、ServicePoint オブジェクトが指定した Uniform Resource Identifier (URI) に対して行うことができる接続の最大数を確認します。

Console::WriteLine( "ConnectionName = {0}", sp->ConnectionName );

// Display the maximum number of connections allowed on this 
// ServicePoint instance.
Console::WriteLine( "ConnectionLimit = {0}", sp->ConnectionLimit );

// Display the number of connections associated with this 
// ServicePoint instance.
Console::WriteLine( "CurrentConnections = {0}", sp->CurrentConnections );
Console.WriteLine("ConnectionName = " + sp.ConnectionName);

// Display the maximum number of connections allowed on this
// ServicePoint instance.
Console.WriteLine("ConnectionLimit = " + sp.ConnectionLimit);

// Display the number of connections associated with this
// ServicePoint instance.
Console.WriteLine("CurrentConnections = " + sp.CurrentConnections);
Console.WriteLine(("ConnectionName = " + sp.ConnectionName))

' Display the maximum number of connections allowed on this 
' ServicePoint instance.
Console.WriteLine(("ConnectionLimit = " + sp.ConnectionLimit.ToString()))

' Display the number of connections associated with this 
' ServicePoint instance.
Console.WriteLine(("CurrentConnections = " + sp.CurrentConnections.ToString()))

注釈

注意

WebRequestHttpWebRequestServicePointWebClient は廃止されており、新しい開発には使用しないでください。 代わりに HttpClient を使用してください。

ConnectionLimit プロパティは、ServicePoint オブジェクトがインターネット リソースに対して行うことができる接続の最大数を設定します。 ConnectionLimit プロパティの値は、ServicePoint オブジェクトの作成時に ServicePointManager.DefaultConnectionLimit プロパティの値に設定されます。DefaultConnectionLimit に対する後続の変更は、既存の ServicePoint オブジェクトには影響しません。

適用対象

こちらもご覧ください

  • 接続 の管理の