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 или меньше 0.

Примеры

В следующем примере кода используется ConnectionLimit свойство, чтобы проверить максимальное число подключений, ServicePoint может сделать для указанного универсального кода ресурса (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()))

Комментарии

Свойство ConnectionLimit задает максимальное количество подключений, которое ServicePoint объект может установить с интернет-ресурсом. ConnectionLimit Значение свойства устанавливается в значение ServicePointManager.DefaultConnectionLimit свойства при ServicePoint создании объекта; последующие изменения DefaultConnectionLimit не оказывают влияния на существующие ServicePoint объекты.

Применяется к

См. также раздел