MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / joinGroup

Method joinGroup

tools/streamer_recorder/PracticalSocket.cpp:361–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361void 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
373void UDPSocket::leaveGroup(const string &multicastGroup) throw(SocketException) {
374 struct ip_mreq multicastRequest;

Callers

nothing calls this directly

Calls 1

SocketExceptionClass · 0.85

Tested by

no test coverage detected