Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
Use the MCAST_JOIN_GROUP socket option to join a multicast group and set the IPv4 or IPv6 multicast address and the local interface index. Use the SETSOCKOPT API and specify the address of the GROUP_REQ structure that contains the address and the interface index. The application can join multiple multicast groups on a single socket and can also join the same group on multiple interfaces on the same socket. However, there is a maximum limit of 20 groups per single UDP socket and there is a maximum limit of 256 groups per single RAW socket. The stack chooses a default multicast interface if the interface index 0 is passed. The format of the GROUP_REQ structure is in the BPXYSOCK macro. The assembler program example in Figure 1 shows this socket option using the EZASMI macro: Figure 1. MCAST_JOIN_GROUP
and MCAST_LEAVE_GROUP
To remove the host from the multicast host group you must issue a SETSOCKOPT call with the MCAST_LEAVE_GROUP option. Using this call is similar to using the MCAST_JOIN_GROUP option because it also uses the GROUP_REQ structure to declare the multicast address and the local interface index. You can also use MCAST_LEAVE_GROUP option to remove all sources for a given multicast group. While the application is a member of the multicast host group, datagrams can be sent or received as required. To see the multicast groups that are joined on an interface, use the Netstat DEvlinks/-d command. To see the multicast groups that are joined on a socket, use the Netstat ALL/-A command. |
Copyright IBM Corporation 1990, 2014
|