Share via


IPGlobalStatistics.DefaultTtl Proprietà

Definizione

Ottiene il valore predefinito TTL (Time-To-Live, durata) dei pacchetti IP (Internet Protocol).

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

Valore della proprietà

Valore Int64 che specifica il TTL.

Attributi

Esempio

Nell'esempio di codice seguente viene visualizzato il valore di questa proprietà.

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

Commenti

Il valore TTL viene segnalato come numero di nodi di routing che possono inoltrare un pacchetto prima che venga rimosso. Ogni nodo decrementa il valore TTL corrente in un pacchetto prima di inoltrarlo. Se il valore TTL raggiunge zero, il pacchetto viene considerato non recapitabile e viene rimosso. Si noti che quando un pacchetto viaggia da un nodo a un altro, questo è noto anche come "hop".

Si applica a