diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-09-01 19:18:23 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-09-01 19:18:23 +0200 |
commit | 4cf4617b81e023abda4c63284a3d239743dfcb01 (patch) | |
tree | 464b0e4f469b1e9b3281a0f1295317b4b9f592ce /cpp/src/Ice/UdpTransceiver.cpp | |
parent | Fix for IceBox tests with ARM (diff) | |
download | ice-4cf4617b81e023abda4c63284a3d239743dfcb01.tar.bz2 ice-4cf4617b81e023abda4c63284a3d239743dfcb01.tar.xz ice-4cf4617b81e023abda4c63284a3d239743dfcb01.zip |
Fixed ICE-6757 - allow Windows 10 UAP apps to re-use multicast addr
Diffstat (limited to 'cpp/src/Ice/UdpTransceiver.cpp')
-rw-r--r-- | cpp/src/Ice/UdpTransceiver.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index cabe30f8cdf..a87b51b65cf 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -953,6 +953,14 @@ IceInternal::UdpTransceiver::UdpTransceiver(const ProtocolInstancePtr& instance, #else DatagramSocket^ socket = safe_cast<DatagramSocket^>(_fd); IceUtil::Handle<UdpTransceiver> self(this); +# if _WIN32_WINNT >= 0x0A00 + // On Windows 10, it's necessary to set this property to allow Win32 applications to + // bind to the same multicast address + if(isMulticast(_addr)) + { + socket->Control->MulticastOnly = true; + } +# endif socket->MessageReceived += ref new TypedEventHandler<DatagramSocket^, DatagramSocketMessageReceivedEventArgs^>( [=](DatagramSocket^ fd, DatagramSocketMessageReceivedEventArgs^ args) { @@ -1000,6 +1008,14 @@ IceInternal::UdpTransceiver::UdpTransceiver(const UdpEndpointIPtr& endpoint, con _mcastAddr.saStorage.ss_family = AF_UNSPEC; #else DatagramSocket^ socket = safe_cast<DatagramSocket^>(_fd); +# if _WIN32_WINNT >= 0x0A00 + // On Windows 10, it's necessary to set this property to allow Win32 applications to + // bind to the same multicast address + if(isMulticast(_addr)) + { + socket->Control->MulticastOnly = true; + } +# endif IceUtil::Handle<UdpTransceiver> self(this); socket->MessageReceived += ref new TypedEventHandler<DatagramSocket^, DatagramSocketMessageReceivedEventArgs^>( [=](DatagramSocket^ fd, DatagramSocketMessageReceivedEventArgs^ args) |