MulticastOption Constructor (IPAddress^, IPAddress^)

 

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

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

public:
MulticastOption(
	IPAddress^ group,
	IPAddress^ mcint
)

Parameters

group
Type: System.Net::IPAddress^

The group IPAddress.

mcint
Type: System.Net::IPAddress^

The local IPAddress.

Exception Condition
ArgumentNullException

group is null.

-or-

mcint is null.

For machines with multiple network cards, you must use this constructor to create MulticastOption instances.

The following example creates a MulticastOption object.

// Define a MuticastOption object specifying the multicast group
// address and the local IPAddress.
// The multicast group address is the same one used by the server.
mcastOption = gcnew MulticastOption( mcastAddress,localIPAddr );
mcastSocket->SetSocketOption( SocketOptionLevel::IP, SocketOptionName::AddMembership, mcastOption );

.NET Framework
Available since 1.1
Return to top
Show: