ServicePoint.ConnectionLimit Proprietà

Definizione

Ottiene o imposta il numero massimo di connessioni consentite sull'oggetto 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

Valore della proprietà

Numero massimo di connessioni consentite sull'oggetto ServicePoint.

Eccezioni

Il limite di connessione è minore o uguale a 0.

Esempio

Nell'esempio di codice seguente viene usata la ConnectionLimit proprietà per controllare il numero massimo di connessioni che l'oggetto può eseguire all'URI ServicePoint (Uniform Resource Identifier) specificato.

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

Commenti

La ConnectionLimit proprietà imposta il numero massimo di connessioni che l'oggetto ServicePoint può effettuare in una risorsa Internet. Il valore della proprietà è impostato sul valore della ConnectionLimitServicePointManager.DefaultConnectionLimit proprietà quando viene creato l'oggetto ServicePoint . Le modifiche DefaultConnectionLimit successive non hanno alcun effetto sugli oggetti esistenti ServicePoint .

Si applica a

Vedi anche