DatagramSocket.JoinMulticastGroup | joinMulticastGroup method

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 (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

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

See also

DatagramSocket

 

 

Show:
© 2015 Microsoft