From 6a0c45589a89684d7c82bcc5498e78c6060e0887 Mon Sep 17 00:00:00 2001 From: knonomura Date: Wed, 15 May 2019 14:27:06 +0900 Subject: [PATCH] add the setting for IP_MULTICAST_ALL --- utility/util/net.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utility/util/net.cpp b/utility/util/net.cpp index e15c7ec..193b387 100644 --- a/utility/util/net.cpp +++ b/utility/util/net.cpp @@ -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: {