UdpStatistics Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Tillhandahåller statistiska udp-data (User Datagram Protocol).
public ref class UdpStatistics abstract
public abstract class UdpStatistics
type UdpStatistics = class
Public MustInherit Class UdpStatistics
- Arv
-
UdpStatistics
Exempel
I följande kodexempel visas UDP-statistiken för den angivna adressfamiljen.
public static void ShowUdpStatistics(NetworkInterfaceComponent version)
{
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
UdpStatistics udpStat = null;
switch (version)
{
case NetworkInterfaceComponent.IPv4:
udpStat = properties.GetUdpIPv4Statistics();
Console.WriteLine("UDP IPv4 Statistics");
break;
case NetworkInterfaceComponent.IPv6:
udpStat = properties.GetUdpIPv6Statistics();
Console.WriteLine("UDP IPv6 Statistics");
break;
default:
throw new ArgumentException("version");
// break;
}
Console.WriteLine(" Datagrams Received ...................... : {0}",
udpStat.DatagramsReceived);
Console.WriteLine(" Datagrams Sent .......................... : {0}",
udpStat.DatagramsSent);
Console.WriteLine(" Incoming Datagrams Discarded ............ : {0}",
udpStat.IncomingDatagramsDiscarded);
Console.WriteLine(" Incoming Datagrams With Errors .......... : {0}",
udpStat.IncomingDatagramsWithErrors);
Console.WriteLine(" UDP Listeners ........................... : {0}",
udpStat.UdpListeners);
Console.WriteLine("");
}
Kommentarer
Instanser av den här klassen returneras av GetUdpIPv4Statistics metoderna och GetUdpIPv6Statistics för att ge program åtkomst till UDP-trafikinformation.
Informationen i den här klassen korrelerar med de hanteringsinformationsobjekt som beskrivs i https://www.ietf.org/rfc/rfc2013.txt.
Konstruktorer
| Name | Description |
|---|---|
| UdpStatistics() |
Initierar en ny instans av UdpStatistics klassen. |
Egenskaper
| Name | Description |
|---|---|
| DatagramsReceived |
Hämtar antalet UDP-datagram (User Datagram Protocol) som togs emot. |
| DatagramsSent |
Hämtar antalet UDP-datagram (User Datagram Protocol) som skickades. |
| IncomingDatagramsDiscarded |
Hämtar antalet UDP-datagram (User Datagram Protocol) som togs emot och togs bort på grund av portfel. |
| IncomingDatagramsWithErrors |
Hämtar antalet UDP-datagram (User Datagram Protocol) som togs emot och togs bort på grund av andra fel än felaktig portinformation. |
| UdpListeners |
Hämtar antalet lokala slutpunkter som lyssnar efter UDP-datagram (User Datagram 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) |