TcpConnectionInformation Klass

Definition

Innehåller information om TCP-anslutningar (Transmission Control Protocol) på den lokala datorn.

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

Exempel

I följande exempel visas slutpunktsinformation för aktiva TCP-anslutningar.

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

Kommentarer

TCP är ett anslutningsorienterat tillförlitligt protokoll för att transportera data mellan nätverksbaserade datorer. Det definieras i IETF RFC 793.

Konstruktorer

Name Description
TcpConnectionInformation()

Initierar en ny instans av TcpConnectionInformation klassen.

Egenskaper

Name Description
LocalEndPoint

Hämtar den lokala slutpunkten för en TCP-anslutning (Transmission Control Protocol).

RemoteEndPoint

Hämtar fjärrslutpunkten för en TCP-anslutning (Transmission Control Protocol).

State

Hämtar tillståndet för den här TCP-anslutningen (Transmission Control Protocol).

Metoder

Name Description
Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Gäller för