Bagikan melalui


TcpStatistics Kelas

Definisi

Menyediakan data statistik Protokol Kontrol Transmisi (TCP).

public ref class TcpStatistics abstract
public abstract class TcpStatistics
type TcpStatistics = class
Public MustInherit Class TcpStatistics
Warisan
TcpStatistics

Contoh

Contoh kode berikut menampilkan statistik TCP untuk keluarga alamat yang ditentukan.

void ShowTcpStatistics( NetworkInterfaceComponent version )
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   TcpStatistics ^ tcpstat = nullptr;
   Console::WriteLine( "" );
   switch ( version )
   {
      case NetworkInterfaceComponent::IPv4:
         tcpstat = properties->GetTcpIPv4Statistics();
         Console::WriteLine( "TCP/IPv4 Statistics:" );
         break;

      case NetworkInterfaceComponent::IPv6:
         tcpstat = properties->GetTcpIPv6Statistics();
         Console::WriteLine( "TCP/IPv6 Statistics:" );
         break;

      default:
         throw gcnew ArgumentException( "version" );
         break;
   }
   Console::WriteLine( "  Minimum Transmission Timeout............. : {0}",
      tcpstat->MinimumTransmissionTimeout );
   Console::WriteLine( "  Maximum Transmission Timeout............. : {0}",
      tcpstat->MaximumTransmissionTimeout );
   Console::WriteLine( "  Connection Data:" );
   Console::WriteLine( "      Current  ............................ : {0}",
      tcpstat->CurrentConnections );
   Console::WriteLine( "      Cumulative .......................... : {0}",
      tcpstat->CumulativeConnections );
   Console::WriteLine( "      Initiated ........................... : {0}",
      tcpstat->ConnectionsInitiated );
   Console::WriteLine( "      Accepted ............................ : {0}",
      tcpstat->ConnectionsAccepted );
   Console::WriteLine( "      Failed Attempts ..................... : {0}",
      tcpstat->FailedConnectionAttempts );
   Console::WriteLine( "      Reset ............................... : {0}",
      tcpstat->ResetConnections );
   Console::WriteLine( "" );
   Console::WriteLine( "  Segment Data:" );
   Console::WriteLine( "      Received  ........................... : {0}",
      tcpstat->SegmentsReceived );
   Console::WriteLine( "      Sent ................................ : {0}",
      tcpstat->SegmentsSent );
   Console::WriteLine( "      Retransmitted ....................... : {0}",
      tcpstat->SegmentsResent );
   Console::WriteLine( "" );
}
public static void ShowTcpStatistics(NetworkInterfaceComponent version)
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    TcpStatistics tcpstat = null;
    Console.WriteLine("");
    switch (version)
    {
        case NetworkInterfaceComponent.IPv4:
             tcpstat = properties.GetTcpIPv4Statistics();
            Console.WriteLine("TCP/IPv4 Statistics:");
            break;
        case NetworkInterfaceComponent.IPv6:
            tcpstat = properties.GetTcpIPv6Statistics();
            Console.WriteLine("TCP/IPv6 Statistics:");
            break;
        default:
            throw new ArgumentException("version");
        //    break;
    }
    Console.WriteLine("  Minimum Transmission Timeout............. : {0}",
        tcpstat.MinimumTransmissionTimeout);
    Console.WriteLine("  Maximum Transmission Timeout............. : {0}",
        tcpstat.MaximumTransmissionTimeout);

    Console.WriteLine("  Connection Data:");
    Console.WriteLine("      Current  ............................ : {0}",
    tcpstat.CurrentConnections);
    Console.WriteLine("      Cumulative .......................... : {0}",
        tcpstat.CumulativeConnections);
    Console.WriteLine("      Initiated ........................... : {0}",
        tcpstat.ConnectionsInitiated);
    Console.WriteLine("      Accepted ............................ : {0}",
        tcpstat.ConnectionsAccepted);
    Console.WriteLine("      Failed Attempts ..................... : {0}",
        tcpstat.FailedConnectionAttempts);
    Console.WriteLine("      Reset ............................... : {0}",
        tcpstat.ResetConnections);

    Console.WriteLine("");
    Console.WriteLine("  Segment Data:");
    Console.WriteLine("      Received  ........................... : {0}",
        tcpstat.SegmentsReceived);
    Console.WriteLine("      Sent ................................ : {0}",
        tcpstat.SegmentsSent);
    Console.WriteLine("      Retransmitted ....................... : {0}",
        tcpstat.SegmentsResent);

    Console.WriteLine("");
}

Keterangan

Instans kelas ini dikembalikan oleh GetTcpIPv4Statistics metode dan GetTcpIPv6Statistics , untuk memberi aplikasi akses ke informasi lalu lintas TCP.

Informasi di kelas ini berkorelasi dengan objek informasi manajemen yang dijelaskan dalam https://www.ietf.org/rfc/rfc2012.txt.

Konstruktor

TcpStatistics()

Menginisialisasi instans baru kelas TcpStatistics.

Properti

ConnectionsAccepted

Mendapatkan jumlah permintaan koneksi Protokol Kontrol Transmisi (TCP) yang diterima.

ConnectionsInitiated

Mendapatkan jumlah permintaan koneksi Protokol Kontrol Transmisi (TCP) yang dibuat oleh klien.

CumulativeConnections

Menentukan jumlah total koneksi Protokol Kontrol Transmisi (TCP) yang dibuat.

CurrentConnections

Mendapatkan jumlah koneksi Protokol Kontrol Transmisi (TCP) saat ini.

ErrorsReceived

Mendapatkan jumlah kesalahan Protokol Kontrol Transmisi (TCP) yang diterima.

FailedConnectionAttempts

Mendapatkan jumlah upaya koneksi Protokol Kontrol Transmisi (TCP) yang gagal.

MaximumConnections

Mendapatkan jumlah maksimum koneksi Protokol Kontrol Transmisi (TCP) yang didukung.

MaximumTransmissionTimeout

Mendapatkan nilai batas waktu transmisi ulang maksimum untuk segmen Protokol Kontrol Transmisi (TCP).

MinimumTransmissionTimeout

Mendapatkan nilai batas waktu transmisi ulang minimum untuk segmen Protokol Kontrol Transmisi (TCP).

ResetConnections

Mendapatkan jumlah paket RST yang diterima oleh koneksi Protokol Kontrol Transmisi (TCP).

ResetsSent

Mendapatkan jumlah segmen Protokol Kontrol Transmisi (TCP) yang dikirim dengan set bendera reset.

SegmentsReceived

Mendapatkan jumlah segmen Protokol Kontrol Transmisi (TCP) yang diterima.

SegmentsResent

Mendapatkan jumlah segmen Protokol Kontrol Transmisi (TCP) yang dikirim ulang.

SegmentsSent

Mendapatkan jumlah segmen Protokol Kontrol Transmisi (TCP) yang dikirim.

Metode

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk