Export (0) Print
Expand All

ServicePoint.ConnectionName Property

Gets the connection group name established by the WebRequest that created the connection.

[Visual Basic]
Public ReadOnly Property ConnectionName As String
[C#]
public string ConnectionName {get;}
[C++]
public: __property String* get_ConnectionName();
[JScript]
public function get ConnectionName() : String;

Property Value

A string containing the connection group name assigned by the WebRequest instance that created the connection.

Remarks

The ConnectionName property contains the connection group assigned to the ConnectionGroupName property of the WebRequest that initiated the connection provided by this ServicePoint. If the ConnectionName property is set, only WebRequest instances with the same ConnectionGroupName can use this ServicePoint.

Example

[Visual Basic] 
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()))


[C#] 
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);


[C++] 
Console::WriteLine(S"ConnectionName = {0}", sp->ConnectionName);

// Display the maximum number of connections allowed on this 
// ServicePoint instance.
Console::WriteLine(S"ConnectionLimit = {0}", __box(sp->ConnectionLimit));

// Display the number of connections associated with this 
// ServicePoint instance.
Console::WriteLine(S"CurrentConnections = {0}", __box(sp->CurrentConnections));        

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

ServicePoint Class | ServicePoint Members | System.Net Namespace | Connection Grouping

Show:
© 2014 Microsoft