Join the specified multicast group.
Definition at line 364 of file PracticalSocket.cpp. References Socket::sockDesc. 00364 { 00365 struct ip_mreq multicastRequest; 00366 00367 multicastRequest.imr_multiaddr.s_addr = inet_addr(multicastGroup.c_str()); 00368 multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY); 00369 if (setsockopt(sockDesc, IPPROTO_IP, IP_ADD_MEMBERSHIP, 00370 (raw_type *) &multicastRequest, 00371 sizeof(multicastRequest)) < 0) { 00372 throw SocketException("Multicast group join failed (setsockopt())", true); 00373 } 00374 }
|