DatagramSocket.JoinMulticastGroup | joinMulticastGroup method

Applies to Windows and Windows Phone

Joins a DatagramSocket object to a multicast group.

Syntax


datagramSocket.joinMulticastGroup(host);

Parameters

host

Type: HostName

The hostname or IP address for the multicast group.

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

DatagramSocket

 

 

Show:
© 2014 Microsoft