ServicePoint.ConnectionLimit Vlastnost

Definice

Získá nebo nastaví maximální počet připojení povolený pro tento ServicePoint objekt.

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

Hodnota vlastnosti

Maximální počet povolených připojení pro tento ServicePoint objekt.

Výjimky

Limit připojení je roven nebo menší než 0.

Příklady

Následující příklad kódu používá ConnectionLimit vlastnost ke kontrole maximálního počtu připojení, které ServicePoint objekt může provést se zadaným identifikátorem URI (Uniform Resource Identifier).

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

Poznámky

Vlastnost ConnectionLimit nastaví maximální počet připojení, která ServicePoint objekt může vytvořit k internetovému prostředku. Hodnota ConnectionLimit vlastnosti je nastavena na hodnotu ServicePointManager.DefaultConnectionLimit vlastnosti při vytvoření objektu ServicePoint ; následné změny DefaultConnectionLimit nemají žádný vliv na existující ServicePoint objekty.

Platí pro

Viz také