Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IPv6MulticastOption Constructor (IPAddress, Int64)

Initializes a new instance of the IPv6MulticastOption class with the specified IP multicast group and the local interface address.

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

public IPv6MulticastOption(
	IPAddress group,
	long ifindex


Type: System.Net.IPAddress

The group IPAddress.

Type: System.Int64

The local interface address.


ifindex is less than 0.


ifindex is greater than 0x00000000FFFFFFFF.


group is null.

The ifindex parameter specifies the interface on which data is received or sent.

The following example creates an IPv6MulticastOption object.

  // Instantiate IPv6MulticastOption using another  
  // overloaded constructor.
  IPv6MulticastOption ipv6MulticastOption2 = new IPv6MulticastOption(group, interfaceIndex);

  // Store the IPAdress multicast options. 
  group =  ipv6MulticastOption2.Group;
  interfaceIndex = ipv6MulticastOption2.InterfaceIndex;

  // Display the IPv6MulticastOption2 properties.
  Console.WriteLine("IPv6MulticastOption.Group: [" + group  + "]");
  Console.WriteLine("IPv6MulticastOption.InterfaceIndex: [" + interfaceIndex + "]");

  // Join the specified multicast group using one of the  
  // JoinMulticastGroup overloaded methods.
  clientOriginator.JoinMulticastGroup((int)interfaceIndex, group);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft