TcpConnectionInformation Klasa

Definicja

Zawiera informacje o połączeniach protokołu TCP (Transmission Control Protocol) na komputerze lokalnym.

public ref class TcpConnectionInformation abstract
public abstract class TcpConnectionInformation
type TcpConnectionInformation = class
Public MustInherit Class TcpConnectionInformation
Dziedziczenie
TcpConnectionInformation

Przykłady

Poniższy przykład przedstawia informacje o punkcie końcowym dla aktywnych połączeń TCP.

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 );
   }
}
public static void GetTcpConnections()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    TcpConnectionInformation[] connections = properties.GetActiveTcpConnections();

    foreach (TcpConnectionInformation t in connections)
    {
        Console.Write("Local endpoint: {0} ",t.LocalEndPoint.Address);
        Console.Write("Remote endpoint: {0} ",t.RemoteEndPoint.Address);
        Console.WriteLine("{0}",t.State);
    }
    Console.WriteLine();
}
Public Shared Sub GetTcpConnections() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim connections As TcpConnectionInformation() = properties.GetActiveTcpConnections()
    
    Dim t As TcpConnectionInformation
    For Each t In  connections
        Console.Write("Local endpoint: {0} ", t.LocalEndPoint.Address)
        Console.Write("Remote endpoint: {0} ", t.RemoteEndPoint.Address)
        Console.WriteLine("{0}", t.State)
    Next t

End Sub

Uwagi

TCP jest niezawodnym protokołem zorientowanym na połączenie do transportu danych między komputerami sieciowym. Jest on zdefiniowany w dokumencie IETF RFC 793.

Konstruktory

TcpConnectionInformation()

Inicjuje nowe wystąpienie klasy TcpConnectionInformation.

Właściwości

LocalEndPoint

Pobiera lokalny punkt końcowy połączenia protokołu TCP (Transmission Control Protocol).

RemoteEndPoint

Pobiera zdalny punkt końcowy połączenia protokołu TCP (Transmission Control Protocol).

State

Pobiera stan tego połączenia protokołu TCP (Transmission Control Protocol).

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy