System.Net.Sockets.UdpClient.JoinMulticastGroup Method

Adds a System.Net.Sockets.UdpClient to a multicast group.

Syntax

public void JoinMulticastGroup (int ifindex, System.Net.IPAddress multicastAddr)

Parameters

ifindex
The interface index associated with the local IP address on which to join the multicast group.
multicastAddr
The multicast System.Net.IPAddress of the group you want to join.

Remarks

Before joining a multicast group, be sure the socket is bound to the port or endpoint. You can do this by calling one of the constructors that accepts a port or an endpoint as parameter.

The infindex parameter is used to identify a hardware interface on the same link.

Note:

There are several multicast address ranges to choose from. Refer to the IETF RFC 2375.

Note:

You cannot call erload:System.Net.Sockets.UdpClient.JoinMulticastGroup on a System.Net.Sockets.UdpClient constructed without a specific local port (that is, using the UdpClient.#ctor or UdpClient.#ctor(AddressFamily) constructor).

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0