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.

Exception Condition

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
Available since 1.1
Return to top