Functions

Functions

int32_t multicast_join_group (SOCKET *so, char *maddr, uint16_t mport)
 Join a multicast group. More...
 
int32_t multicast_leave_group (SOCKET *so, char *maddr, uint16_t mport)
 Leave a multicast group. More...
 

Detailed Description

Function Documentation

int32_t multicast_join_group ( SOCKET *  so,
char *  maddr,
uint16_t  mport 
)
Parameters
so- socket, which should join the multicast group
maddr- multicast address group string (e.g. "224.0.1.1")
mport- multicast port
Returns
  • > 0 successful
  • = 0 no socket
  • < 0 error

This function adds the specified multicast group to the internal address filter hash table. All packets from this multicast address will pass the address filter. For the UDP socket net_recv() or the callback function method may be used to receive any multicast data. It's allowed to specify more than one group/port for a UDP socket.

Library:
net.lib
Prototype:
net.h
multicast_join_group (udp_socket, "239.255.1.1", 12345);
Examples:
Multicast.c.
int32_t multicast_leave_group ( SOCKET *  so,
char *  maddr,
uint16_t  mport 
)
Parameters
so- socket, which should leave the multicast group
maddr- multicast address group string (e.g. "224.0.1.1")
mport- multicast port
Returns
  • > 0 successful
  • = 0 no socket or address not found
  • < 0 error

This function deletes the multicast group from the internal address filter hash table. No multicast packets for this group will pass the address filter.

Library:
net.lib
Prototype:
net.h
multicast_leave_group (udp_socket, "239.255.1.1", 12345);