| 371 | } |
| 372 | |
| 373 | void UDPSocket::leaveGroup(const string &multicastGroup) throw(SocketException) { |
| 374 | struct ip_mreq multicastRequest; |
| 375 | |
| 376 | multicastRequest.imr_multiaddr.s_addr = inet_addr(multicastGroup.c_str()); |
| 377 | multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY); |
| 378 | if (setsockopt(sockDesc, IPPROTO_IP, IP_DROP_MEMBERSHIP, |
| 379 | (raw_type *) &multicastRequest, |
| 380 | sizeof(multicastRequest)) < 0) { |
| 381 | throw SocketException("Multicast group leave failed (setsockopt())", true); |
| 382 | } |
| 383 | } |
nothing calls this directly
no test coverage detected