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使用して、オブジェクトが指定した Uniform Resource Identifier (URI) に対して行うことができる接続ServicePointの最大数をチェックします。

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()))

注釈

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

適用対象

こちらもご覧ください