NetworkInterface.SupportsMulticast Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a Boolean value that indicates whether the network interface is enabled to receive multicast packets.

Namespace:   System.Net.NetworkInformation
Assembly:  System (in System.dll)

public virtual bool SupportsMulticast { get; }

Property Value

Type: System.Boolean

true if the interface receives multicast packets; otherwise, false.

Exception Condition
PlatformNotSupportedException

This property is not valid on computers running operating systems earlier than Windows XP.

Multicasting is the act of sending a data packet to multiple destinations simultaneously.

The following code example displays a summary for all interfaces on the local computer.

 public static void DisplayTypeAndAddress()
{
    IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
    NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
    Console.WriteLine("Interface information for {0}.{1}     ",
            computerProperties.HostName, computerProperties.DomainName);
    foreach (NetworkInterface adapter in nics)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        Console.WriteLine(adapter.Description);
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
        Console.WriteLine("  Interface type .......................... : {0}", adapter.NetworkInterfaceType);
        Console.WriteLine("  Physical Address ........................ : {0}", 
                   adapter.GetPhysicalAddress().ToString());
        Console.WriteLine("  Is receive only.......................... : {0}", adapter.IsReceiveOnly);
        Console.WriteLine("  Multicast................................ : {0}", adapter.SupportsMulticast);
        Console.WriteLine();
      }
   }

.NET Framework
Available since 2.0
Return to top
Show: