summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 4e1c8620085..32ab7600c88 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -449,10 +449,19 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, const s
}
if(IN_MULTICAST(ntohl(_addr.sin_addr.s_addr)))
{
+ setReuseAddress(_fd, true);
struct sockaddr_in addr;
+
+ //
+ // Windows does not allow binding to the mcast address itself
+ // so we bind to INADDR_ANY (0.0.0.0) instead.
+ //
+#ifdef _WIN32
getAddress("0.0.0.0", port, addr);
- setReuseAddress(_fd, true);
doBind(_fd, addr);
+#else
+ doBind(_fd, _addr);
+#endif
if(mcastInterface.length() > 0)
{
getAddress(mcastInterface, port, addr);