IPv6InterfaceProperties.Mtu 속성

정의

이 네트워크 인터페이스의 MTU(최대 전송 단위)를 가져옵니다.

public:
 abstract property int Mtu { int get(); };
public abstract int Mtu { get; }
member this.Mtu : int
Public MustOverride ReadOnly Property Mtu As Integer

속성 값

MTU를 나타내는 Int64 값입니다.

예제

다음 코드 예제에서는 개체를 IPv6InterfaceProperties 가져오고 해당 데이터를 표시합니다.

void DisplayIPv6NetworkInterfaces()
{
   array<NetworkInterface^>^nics = NetworkInterface::GetAllNetworkInterfaces();
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   Console::WriteLine( "IPv6 interface information for {0}.{1}", 
       properties->HostName, properties->DomainName );

   int count = 0;

   System::Collections::IEnumerator^ myEnum24 = nics->GetEnumerator();
   while ( myEnum24->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum24->Current);

      // Only display informatin for interfaces that support IPv6.
      if ( adapter->Supports( NetworkInterfaceComponent::IPv6 ) == false )
      {
         continue;
      }
      
      count++;
      
      Console::WriteLine();
      Console::WriteLine( adapter->Description );

      // Underline the description.
      Console::WriteLine( String::Empty->PadLeft( adapter->Description->Length, '=' ) );
      IPInterfaceProperties ^ adapterProperties = adapter->GetIPProperties();

      // Try to get the IPv6 interface properties.
      IPv6InterfaceProperties ^ p = adapterProperties->GetIPv6Properties();
      if ( !p )
      {
         Console::WriteLine( "No IPv6 information is available for this interface." );
         continue;
      }

      // Display the IPv6 specific data.
      Console::WriteLine( "  Index ............................. : {0}", 
         p->Index );
      Console::WriteLine( "  MTU ............................... : {0}", 
         p->Mtu );
   }
   if (count == 0)
   {
       Console::WriteLine("  No IPv6 interfaces were found.");
       Console::WriteLine();
   }
}
public static void DisplayIPv6NetworkInterfaces()
{
    NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    Console.WriteLine("IPv6 interface information for {0}.{1}",
       properties.HostName, properties.DomainName);

    int count = 0;

    foreach (NetworkInterface adapter in nics)
    {
        // Only display informatin for interfaces that support IPv6.
        if (adapter.Supports(NetworkInterfaceComponent.IPv6) == false)
        {
            continue;
        }

        count++;

        Console.WriteLine();
        Console.WriteLine(adapter.Description);
        // Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));

        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        // Try to get the IPv6 interface properties.
        IPv6InterfaceProperties p = adapterProperties.GetIPv6Properties();

        if (p == null)
        {
            Console.WriteLine("No IPv6 information is available for this interface.");
            Console.WriteLine();
            continue;
        }
        // Display the IPv6 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index);
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu);
    }

    if (count == 0)
    {
        Console.WriteLine("  No IPv6 interfaces were found.");
        Console.WriteLine();
    }
}
Public Shared Sub DisplayIPv6NetworkInterfaces() 
    Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Console.WriteLine("IPv6 interface information for {0}.{1}", properties.HostName, properties.DomainName)
    
    Dim count as Integer = 0
    
    Dim adapter As NetworkInterface
    For Each adapter In  nics
        ' Only display informatin for interfaces that support IPv6.
        If adapter.Supports(NetworkInterfaceComponent.IPv6) = False Then
            GoTo ContinueForEach1
        End If
        count += 1
        
        Console.WriteLine()
        Console.WriteLine(adapter.Description)
        ' Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length, "="c))
        
        Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
        ' Try to get the IPv6 interface properties.
        Dim p As IPv6InterfaceProperties = adapterProperties.GetIPv6Properties()
        
        
        If p Is Nothing Then
            Console.WriteLine("No IPv6 information is available for this interface.")
            GoTo ContinueForEach1
        End If
        ' Display the IPv6 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index)
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu)
    ContinueForEach1:
    Next adapter

    if count = 0 then
        Console.WriteLine("  No IPv6 interfaces were found.")
        Console.WriteLine()
    End if

End Sub

설명

네트워크 인터페이스의 MTU는 전송할 수 있는 가장 큰 패킷입니다. 옥텟(8비트 바이트)으로 측정됩니다.

적용 대상