IPGlobalStatistics.DefaultTtl Właściwość

Definicja

Pobiera domyślną wartość czasu wygaśnięcia (TTL) dla pakietów protokołu internetowego (IP).

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

Wartość właściwości

Int64 Wartość określająca czas wygaśnięcia.

Atrybuty

Przykłady

Poniższy przykład kodu wyświetla wartość tej właściwości.

void ShowIPStatistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = properties->GetIPv4GlobalStatistics();
   Console::WriteLine( "  Forwarding enabled ...................... : {0}", 
      ipstat->ForwardingEnabled );
   Console::WriteLine( "  Interfaces .............................. : {0}", 
      ipstat->NumberOfInterfaces );
   Console::WriteLine( "  IP addresses ............................ : {0}", 
      ipstat->NumberOfIPAddresses );
   Console::WriteLine( "  Routes .................................. : {0}", 
      ipstat->NumberOfRoutes );
   Console::WriteLine( "  Default TTL ............................. : {0}", 
      ipstat->DefaultTtl );
}
public static void ShowIPStatistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Forwarding enabled ...................... : {0}",
        ipstat.ForwardingEnabled);
    Console.WriteLine("  Interfaces .............................. : {0}",
        ipstat.NumberOfInterfaces);
    Console.WriteLine("  IP addresses ............................ : {0}",
        ipstat.NumberOfIPAddresses);
    Console.WriteLine("  Routes .................................. : {0}",
        ipstat.NumberOfRoutes);
    Console.WriteLine("  Default TTL ............................. : {0}",
        ipstat.DefaultTtl);
}
Public Shared Sub ShowIPStatistics() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    Console.WriteLine("  Forwarding enabled ...................... : {0}", ipstat.ForwardingEnabled)
    Console.WriteLine("  Interfaces .............................. : {0}", ipstat.NumberOfInterfaces)
    Console.WriteLine("  IP addresses ............................ : {0}", ipstat.NumberOfIPAddresses)
    Console.WriteLine("  Routes .................................. : {0}", ipstat.NumberOfRoutes)
    Console.WriteLine("  Default TTL ............................. : {0}", ipstat.DefaultTtl)

End Sub

Uwagi

Wartość czasu wygaśnięcia jest zgłaszana jako liczba węzłów routingu, które mogą przekazywać pakiet przed odrzuceniem. Każdy węzeł dekrementuje bieżącą wartość czasu wygaśnięcia w pakiecie przed przekazaniem go. Jeśli wartość czasu wygaśnięcia osiągnie zero, pakiet zostanie uznany za niedostarczalny i zostanie odrzucony. Należy pamiętać, że gdy pakiet jest przesyłany z jednego węzła do drugiego, jest to również nazywane "przeskokiem".

Dotyczy