Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
IP_ADD_SOURCE_MEMBERSHIP and IP_DROP_SOURCE_MEMBERSHIP z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
Use the IP_ADD_SOURCE_MEMBERSHIP option to join an IPv4 multicast group on an IPv4 interface and specify the IPv4 source-filter address. Set these values by using the SETSOCKOPT API and specifying the address of the IP_MREQ_SOURCE structure that contains these addresses. The application can join multiple source 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 an interface with the value 0 is passed. The format of the IP_MREQ_SOURCE structure is in the BPXYSOCK macro. The assembler program example in Figure 1 shows this socket option using the EZASMI macro: Figure 1. IP_ADD_SOURCE_MEMBERSHIP
and IP_DROP_SOURCE_MEMBERSHIP
To remove the host from the source multicast host group you must issue a SETSOCKOPT call with the IP_DROP_SOURCE_MEMBERSHIP option. Using this call is similar to using the IP_ADD_SOURCE_MEMBERSHIP option; both use the IP_MREQ_SOURCE structure to declare the IPv4 multicast address, IPv4 source address, and the local IPv4 address interface. While the application is a member of the source 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
|