Редагувати

Поділитися через


ServicePoint.CurrentConnections Property

Definition

Gets the number of open connections associated with this ServicePoint object.

public:
 property int CurrentConnections { int get(); };
public int CurrentConnections { get; }
member this.CurrentConnections : int
Public ReadOnly Property CurrentConnections As Integer

Property Value

The number of open connections associated with this ServicePoint object.

Examples

The following code example uses the CurrentConnections property to determine the number of open Internet connections associated with this ServicePoint object.

// Display the ServicePoint Internet resource address.
Console::WriteLine( "Address = {0}", sp->Address );
// Display the ServicePoint Internet resource address.
Console.WriteLine("Address = {0} ", sp.Address.ToString());
' Display the ServicePoint Internet resource address.
Console.WriteLine(("Address = " + sp.Address.ToString()))

Remarks

Caution

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete, and you shouldn't use them for new development. Use HttpClient instead.

The CurrentConnections property contains the number of open Internet connections associated with this ServicePoint object. The value of CurrentConnections cannot exceed that of ConnectionLimit.

Applies to