TcpConnectionInformation::LocalEndPoint Property
.NET Framework (current version)
Gets the local endpoint of a Transmission Control Protocol (TCP) connection.
Assembly: System (in System.dll)
Property Value
Type: System.Net::IPEndPoint^An IPEndPoint instance that contains the IP address and port on the local computer.
The following example displays endpoint information for active TCP connections.
void GetTcpConnections() { IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties(); array<TcpConnectionInformation^>^connections = properties->GetActiveTcpConnections(); System::Collections::IEnumerator^ myEnum = connections->GetEnumerator(); while ( myEnum->MoveNext() ) { TcpConnectionInformation ^ t = safe_cast<TcpConnectionInformation ^>(myEnum->Current); Console::Write( "Local endpoint: {0} ", t->LocalEndPoint->Address ); Console::Write( "Remote endpoint: {0} ", t->RemoteEndPoint->Address ); Console::WriteLine( "{0}", t->State ); } }
.NET Framework
Available since 2.0
Available since 2.0
Show: