diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-22 17:51:17 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-22 17:51:17 +0200 |
commit | 2f7784b69f888e9a84a99a1aff8843d8841d51a2 (patch) | |
tree | 2cf0762030c52c483afbdecea35650cd195f7879 /cpp/src/Ice/UdpTransceiver.cpp | |
parent | ICE-4831 - bogus comparison operators in Python (diff) | |
download | ice-2f7784b69f888e9a84a99a1aff8843d8841d51a2.tar.bz2 ice-2f7784b69f888e9a84a99a1aff8843d8841d51a2.tar.xz ice-2f7784b69f888e9a84a99a1aff8843d8841d51a2.zip |
Fixed ICE-4556 - --interface option not working on some platforms, enabled Java IPv6 tests on Windows
Diffstat (limited to 'cpp/src/Ice/UdpTransceiver.cpp')
-rw-r--r-- | cpp/src/Ice/UdpTransceiver.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index 581f7527960..46e9478e91e 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -871,6 +871,22 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, _peerAddr.ss_family = AF_UNSPEC; // Not initialized yet. // + // NOTE: setting the multicast interface before performing the + // connect is important for some OS such as OS X. + // + if(isMulticast(_addr)) + { + if(mcastInterface.length() > 0) + { + setMcastInterface(_fd, mcastInterface, _addr); + } + if(mcastTtl != -1) + { + setMcastTtl(_fd, mcastTtl, _addr); + } + } + + // // In general, connecting a datagram socket should be non-blocking as this just setups // the default destination address for the socket. However, on some OS, connect sometime // returns EWOULDBLOCK. If that's the case, we keep the state as StateNeedConnect. This @@ -890,17 +906,6 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, }); #endif - if(isMulticast(_addr)) - { - if(mcastInterface.length() > 0) - { - setMcastInterface(_fd, mcastInterface, _addr); - } - if(mcastTtl != -1) - { - setMcastTtl(_fd, mcastTtl, _addr); - } - } #ifdef ICE_USE_IOCP // |