ServicePoint.ConnectionLimit Właściwość

Definicja

Pobiera lub ustawia maksymalną liczbę połączeń dozwolonych dla tego ServicePoint obiektu.

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

Wartość właściwości

Maksymalna liczba połączeń dozwolonych w tym ServicePoint obiekcie.

Wyjątki

Limit połączeń jest równy lub mniejszy niż 0.

Przykłady

W poniższym przykładzie kodu użyto ConnectionLimit właściwości , aby sprawdzić maksymalną liczbę połączeń, które ServicePoint obiekt może wykonać do określonego identyfikatora 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()))

Uwagi

Właściwość ConnectionLimit ustawia maksymalną liczbę połączeń, które ServicePoint obiekt może wykonać do zasobu internetowego. Wartość ConnectionLimit właściwości jest ustawiana na wartość ServicePointManager.DefaultConnectionLimit właściwości podczas ServicePoint tworzenia obiektu. Kolejne zmiany DefaultConnectionLimit nie mają wpływu na istniejące ServicePoint obiekty.

Dotyczy

Zobacz też