| 359 | } |
| 360 | |
| 361 | void UDPSocket::joinGroup(const string &multicastGroup) throw(SocketException) { |
| 362 | struct ip_mreq multicastRequest; |
| 363 | |
| 364 | multicastRequest.imr_multiaddr.s_addr = inet_addr(multicastGroup.c_str()); |
| 365 | multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY); |
| 366 | if (setsockopt(sockDesc, IPPROTO_IP, IP_ADD_MEMBERSHIP, |
| 367 | (raw_type *) &multicastRequest, |
| 368 | sizeof(multicastRequest)) < 0) { |
| 369 | throw SocketException("Multicast group join failed (setsockopt())", true); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | void UDPSocket::leaveGroup(const string &multicastGroup) throw(SocketException) { |
| 374 | struct ip_mreq multicastRequest; |
nothing calls this directly
no test coverage detected