diff options
author | Bernard Normier <bernard@zeroc.com> | 2012-10-22 11:56:37 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2012-10-22 11:56:37 -0400 |
commit | 181203fadb41522d72a6a493f4bbae3cdd8efe0c (patch) | |
tree | 6733c16b84074047c370143d9a30a92f44bd3d31 /cpp/src/Ice/UdpTransceiver.cpp | |
parent | Clarified CLASSPATH setting in README.DEMOS (ICE-4797) (diff) | |
parent | Fixed ICE-4556 - --interface option not working on some platforms, enabled Ja... (diff) | |
download | ice-181203fadb41522d72a6a493f4bbae3cdd8efe0c.tar.bz2 ice-181203fadb41522d72a6a493f4bbae3cdd8efe0c.tar.xz ice-181203fadb41522d72a6a493f4bbae3cdd8efe0c.zip |
Merge branch 'master' of ssh://git/home/git/ice
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 // |