Partager via


ServicePoint.ConnectionLimit Propriété

Définition

Obtient ou définit le nombre maximal de connexions autorisé sur cet objet 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

Valeur de propriété

Nombre maximal de connexions autorisé sur cet objet ServicePoint.

Exceptions

La limite de connexions est égale ou inférieure à 0.

Exemples

L’exemple de code suivant utilise la ConnectionLimit propriété pour vérifier le nombre maximal de connexions que l’objet ServicePoint peut établir avec l’URI spécifié.

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

Remarques

La ConnectionLimit propriété définit le nombre maximal de connexions que l’objet ServicePoint peut établir à une ressource Internet. La valeur de la ConnectionLimit propriété est définie sur la valeur de la propriété lors de la ServicePointManager.DefaultConnectionLimit création de l’objet ; les ServicePoint modifications suivantes n’ont DefaultConnectionLimit aucun effet sur les objets existants ServicePoint .

S’applique à

Voir aussi