Skip to content

Commit

Permalink
add the setting for IP_MULTICAST_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
knonomura committed May 15, 2019
1 parent 78ccc5c commit 6a0c455
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utility/util/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,13 @@ void Socket::setMulticastInterfaceOption(
UTIL_THROW_UTIL_ERROR_CODED(CODE_ILLEGAL_ARGUMENT);
}

#ifndef _WIN32
if (join) {
int value = 0;
setOption(IPPROTO_IP, IP_MULTICAST_ALL, &value, sizeof(value));
}
#endif

struct sockaddr_storage ss;
switch (multicastAddr.getFamily()) {
case AF_INET: {
Expand Down

0 comments on commit 6a0c455

Please sign in to comment.