DatagramSocket.JoinMulticastGroup(HostName) DatagramSocket.JoinMulticastGroup(HostName) DatagramSocket.JoinMulticastGroup(HostName) DatagramSocket.JoinMulticastGroup(HostName) DatagramSocket.JoinMulticastGroup(HostName) Method

Definition

Joins a DatagramSocket object to a multicast group.

public : void JoinMulticastGroup(HostName host)
void JoinMulticastGroup(HostName host) const;
public void JoinMulticastGroup(HostName host)
Public Sub JoinMulticastGroup(host As HostName)
datagramSocket.joinMulticastGroup(host);

Parameters

host
HostName HostName HostName

The hostname or IP address for the multicast group.

Additional features and requirements

Capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

To receive multicast packets on the DatagramSocket object, an app must assign the MessageReceived event to an event handler, bind to a local service name or UDP port and a local hostname or IP address using the BindEndpointAsync or BindServiceNameAsync method, and then call the JoinMulticastGroup method to join the multicast group.

If a network adapter was specified to the BindServiceNameAsync method, only groups on networks present on the specified adapter will be joined.

An app receiving multicast packets may also need to deal with network adapter changes. If network connectivity changes and the local computer or device is assigned a different IP address, the app needs to rejoin the multicast group.