summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/UdpTransceiver.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-01-20 16:52:33 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-01-20 16:52:33 +0100
commit10d9e3aae20e55d9824b632e77d8f14fd67b122f (patch)
treee38f0c77e423d9c1a8a5faf4abfccdfa63a905b3 /cpp/src/Ice/UdpTransceiver.cpp
parentjava:UserException metadata for both local and remote operations (diff)
downloadice-10d9e3aae20e55d9824b632e77d8f14fd67b122f.tar.bz2
ice-10d9e3aae20e55d9824b632e77d8f14fd67b122f.tar.xz
ice-10d9e3aae20e55d9824b632e77d8f14fd67b122f.zip
Fixed ICE-6708 - the UDP transport now join the multicast group on all interfaces by default
Diffstat (limited to 'cpp/src/Ice/UdpTransceiver.cpp')
-rwxr-xr-xcpp/src/Ice/UdpTransceiver.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 6f3ee3540c9..b4f5520c184 100755
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -139,7 +139,7 @@ IceInternal::UdpTransceiver::bind()
// address won't be the multicast address and the client will
// therefore reject the datagram.
//
- const_cast<Address&>(_addr) = getAddressForServer("", _port, getProtocolSupport(_addr), false);
+ const_cast<Address&>(_addr) = getAddressForServer("", _port, getProtocolSupport(_addr), false, false);
#endif
const_cast<Address&>(_addr) = doBind(_fd, _addr, _mcastInterface);
@@ -771,7 +771,12 @@ IceInternal::UdpTransceiver::toDetailedString() const
{
ostringstream os;
os << toString();
- vector<string> intfs = getHostsForEndpointExpand(inetAddrToString(_addr), _instance->protocolSupport(), true);
+ string addr = isAddressValid(_mcastAddr) ? _mcastInterface : inetAddrToString(_addr);
+ vector<string> intfs = getHostsForEndpointExpand(addr, _instance->protocolSupport(), true);
+ if(isAddressValid(_mcastAddr) && intfs.empty())
+ {
+ intfs.push_back(_mcastInterface);
+ }
if(!intfs.empty())
{
os << "\nlocal interfaces = ";
@@ -952,7 +957,7 @@ IceInternal::UdpTransceiver::UdpTransceiver(const UdpEndpointIPtr& endpoint, con
_instance(instance),
_incoming(true),
_bound(false),
- _addr(getAddressForServer(host, port, instance->protocolSupport(), instance->preferIPv6())),
+ _addr(getAddressForServer(host, port, instance->protocolSupport(), instance->preferIPv6(), true)),
_mcastInterface(mcastInterface),
_port(port),
_state(connect ? StateNeedConnect : StateNotConnected)