Udostępnij za pośrednictwem


ServicePoint.ConnectionLimit Właściwość

Definicja

Pobiera lub ustawia maksymalną liczbę połączeń dozwolonych w tym ServicePoint obiekcie.

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łączenia jest równy lub mniejszy niż 0.

Przykłady

Poniższy przykład kodu używa właściwości , ConnectionLimit aby sprawdzić maksymalną liczbę połączeń, które ServicePoint obiekt może wykonać dla 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ż