IPGlobalStatistics.OutputPacketRoutingDiscards 属性

定义

获取已从路由表中丢弃的路由数。

public:
 abstract property long OutputPacketRoutingDiscards { long get(); };
public abstract long OutputPacketRoutingDiscards { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract long OutputPacketRoutingDiscards { get; }
member this.OutputPacketRoutingDiscards : int64
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.OutputPacketRoutingDiscards : int64
Public MustOverride ReadOnly Property OutputPacketRoutingDiscards As Long

属性值

Int64 值,它指定已丢弃的有效路由的总数。

属性

示例

下面的代码示例显示出站 IP 数据包的统计信息。

void ShowOutboundIPStatistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = properties->GetIPv4GlobalStatistics();
   Console::WriteLine( "  Outbound Packet Data:" );
   Console::WriteLine( "      Requested ........................... : {0}", 
      ipstat->OutputPacketRequests );
   Console::WriteLine( "      Discarded ........................... : {0}", 
      ipstat->OutputPacketsDiscarded );
   Console::WriteLine( "      No Routing Discards ................. : {0}", 
      ipstat->OutputPacketsWithNoRoute );
   Console::WriteLine( "      Routing Entry Discards .............. : {0}", 
      ipstat->OutputPacketRoutingDiscards );
}

public static void ShowOutboundIPStatistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Outbound Packet Data:");
    Console.WriteLine("      Requested ........................... : {0}",
        ipstat.OutputPacketRequests);
    Console.WriteLine("      Discarded ........................... : {0}",
        ipstat.OutputPacketsDiscarded);
    Console.WriteLine("      No Routing Discards ................. : {0}",
        ipstat.OutputPacketsWithNoRoute);
    Console.WriteLine("      Routing Entry Discards .............. : {0}",
        ipstat.OutputPacketRoutingDiscards);
}
Public Shared Sub ShowOutboundIPStatistics() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    Console.WriteLine("  Outbound Packet Data:")
    Console.WriteLine("      Requested ........................... : {0}", ipstat.OutputPacketRequests)
    Console.WriteLine("      Discarded ........................... : {0}", ipstat.OutputPacketsDiscarded)
    Console.WriteLine("      No Routing Discards ................. : {0}", ipstat.OutputPacketsWithNoRoute)
    Console.WriteLine("      Routing Entry Discards .............. : {0}", ipstat.OutputPacketRoutingDiscards)

End Sub

注解

放弃有效路由表条目的一个可能原因是为其他条目释放缓冲区空间。

适用于