Udostępnij za pośrednictwem


IcmpV6Statistics.RouterAdvertisementsSent Właściwość

Definicja

Pobiera liczbę wysłanych komunikatów anonsowania routera protokołu ICMPv6 (Internet Control Message Protocol w wersji 6).

public:
 abstract property long RouterAdvertisementsSent { long get(); };
public abstract long RouterAdvertisementsSent { get; }
member this.RouterAdvertisementsSent : int64
Public MustOverride ReadOnly Property RouterAdvertisementsSent As Long

Wartość właściwości

Wartość Int64 określająca łączną liczbę wysłanych komunikatów anonsowania routera.

Przykłady

W poniższym przykładzie jest wyświetlana wartość tej właściwości.

void ShowIcmpV6RouterData()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IcmpV6Statistics ^ statistics = properties->GetIcmpV6Statistics();
   Console::WriteLine( "  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}", 
      statistics->RouterAdvertisementsSent, 
      statistics->RouterAdvertisementsReceived );
   Console::WriteLine( "  Solicits ............................. Sent: {0,-10}   Received: {1,-10}", 
      statistics->RouterSolicitsSent, 
      statistics->RouterSolicitsReceived );
}
public static void ShowIcmpV6RouterData ()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IcmpV6Statistics statistics = properties.GetIcmpV6Statistics();

    Console.WriteLine ("  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}",
        statistics.RouterAdvertisementsSent, statistics.RouterAdvertisementsReceived);
    Console.WriteLine ("  Solicits ............................. Sent: {0,-10}   Received: {1,-10}",
        statistics.RouterSolicitsSent, statistics.RouterSolicitsReceived);
}
Public Shared Sub ShowIcmpV6RouterData() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim statistics As IcmpV6Statistics = properties.GetIcmpV6Statistics()
    
    Console.WriteLine("  Advertisements ....................... Sent: {0,-10}   Received: {1,-10}", statistics.RouterAdvertisementsSent, statistics.RouterAdvertisementsReceived)
    Console.WriteLine("  Solicits ............................. Sent: {0,-10}   Received: {1,-10}", statistics.RouterSolicitsSent, statistics.RouterSolicitsReceived)

End Sub

Uwagi

Zanim komputer hosta będzie mógł wysyłać datagramy IP poza bezpośrednio dołączoną podsiecią, musi odnaleźć adres co najmniej jednego routera w tej podsieci. To odnajdywanie można wykonać przy użyciu komunikatów ICMP nazywanych anonsami routera i żądaniem routera. Komunikat anonsu jest okresowo wysyłany przez router w celu ogłoszenia jego obecności i adresów jego interfejsów. Gdy komputer łączy się z siecią, zamiast czekać na odbieranie anonsów routera, może wysyłać Żądania routera do żądania, że routery wysyłają swoje anonse natychmiast.

Dotyczy