Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kStatus kSocket_JoinMulticastGroup | ( | kSocket | socket,
|  | kIpAddress | group,
|  | kIpAddress | iface
| ) |  |

Joins the specified multicast group on the specified interface.

In order for multicast sockets to behave similarly across all platforms, the following practices are recommended:

- The receiver should bind on the group port and 'any' address (kIpAddress_AnyV4()).
- The receiver should join the multicast group, specifying the group address and the desired local interface address on which to listen for incoming multicast datagrams.
- The sender should bind on the desired local interface address for outgoing multicast datagrams. The sender can use any port (e.g., an ephemeral port via kIP_PORT_ANY).

Note that while some platforms support binding the receiver to the group address (e.g., Linux) other platforms do not (e.g., Windows). Accordingly, the advice given above is to bind the receiver to 'any' address, which works on all platforms. Unfortunately, this means that any unicast or broadcast datagrams that are addressed to the same port identifier may also be received by the multicast socket.

Parameters

  socket | Socket object.
  group | Multicast group address.
  iface | Local interface address.

Returns
  Operation status.