ServicePoint.ConnectionLimit Propiedad

Definición

Obtiene o establece el número máximo de conexiones permitidas en este objeto 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

Valor de propiedad

El número máximo de conexiones permitidas en este objeto ServicePoint.

Excepciones

El límite de conexiones es menor o igual que 0.

Ejemplos

En el ejemplo de código siguiente se usa la ConnectionLimit propiedad para comprobar el número máximo de conexiones que el ServicePoint objeto puede realizar en el identificador uniforme de recursos (URI) especificado.

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

Comentarios

La ConnectionLimit propiedad establece el número máximo de conexiones que el ServicePoint objeto puede realizar en un recurso de Internet. El valor de la ConnectionLimit propiedad se establece en el valor de la ServicePointManager.DefaultConnectionLimit propiedad cuando se crea el ServicePoint objeto; los cambios DefaultConnectionLimit posteriores no tienen ningún efecto en los objetos existentes ServicePoint .

Se aplica a

Consulte también