summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/UdpTransceiver.cpp
diff options
context:
space:
mode:
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)