IcmpV6Statistics.RouterSolicitsReceived 属性

定义

获取接收的 Internet 控制消息协议版本 6 (ICMPv6) 路由器请求消息数。

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

属性值

Int64 值,指定接收的路由器请求消息的总数。

示例

以下示例显示此属性的值。

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

注解

在主机能够在其直接连接的子网之外发送 IP 数据报之前,它必须发现该子网上至少一个路由器的地址。 可以使用称为路由器播发和路由器请求的 ICMP 消息完成此发现。 播发消息由路由器定期发送,以通知其存在及其接口的地址。 当计算机连接到网络时,它可以发送路由器请求,以请求路由器立即发送其广告,而不是等待接收路由器播发。

适用于