diff options
Diffstat (limited to 'cpp/src/Ice')
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 20 | ||||
-rw-r--r-- | cpp/src/Ice/TcpAcceptor.cpp | 21 | ||||
-rw-r--r-- | cpp/src/Ice/UdpTransceiver.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Ice/UdpTransceiver.h | 1 |
4 files changed, 18 insertions, 46 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 6f3081d7ae6..926c5ec11f3 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -1199,25 +1199,17 @@ ObjectAdapterI::parsePublishedEndpoints() { // // If the PublishedEndpoints property isn't set, we compute the published enpdoints - // from the OA endpoints. + // from the OA endpoints, expanding any endpoints that may be listening on INADDR_ANY + // to include actual addresses in the published endpoints. // - transform(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - back_inserter(endpoints), Ice::constMemFun(&IncomingConnectionFactory::endpoint)); - - // - // Expand any endpoints that may be listening on INADDR_ANY to include actual - // addresses in the published endpoints. - // - vector<EndpointIPtr> expandedEndpoints; - for(unsigned int i = 0; i < endpoints.size(); ++i) + for(unsigned int i = 0; i < _incomingConnectionFactories.size(); ++i) { - vector<EndpointIPtr> endps = endpoints[i]->expand(); - expandedEndpoints.insert(expandedEndpoints.end(), endps.begin(), endps.end()); + vector<EndpointIPtr> endps = _incomingConnectionFactories[i]->endpoint()->expand(); + endpoints.insert(endpoints.end(), endps.begin(), endps.end()); } - endpoints = expandedEndpoints; } - if(_instance->traceLevels()->network >= 3) + if(_instance->traceLevels()->network >= 1) { Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat); out << "published endpoints for object adapter `" << getName() << "':\n"; diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp index 453d0cbccc1..1b0e4251ba5 100644 --- a/cpp/src/Ice/TcpAcceptor.cpp +++ b/cpp/src/Ice/TcpAcceptor.cpp @@ -15,6 +15,7 @@ #include <Ice/Network.h> #include <Ice/Exception.h> #include <Ice/Properties.h> +#include <IceUtil/StringUtil.h> #ifdef ICE_USE_IOCP # include <Mswsock.h> @@ -71,22 +72,12 @@ IceInternal::TcpAcceptor::listen() Trace out(_logger, _traceLevels->networkCat); out << "accepting tcp connections at " << toString(); - if(_traceLevels->network >= 3) + vector<string> interfaces = + getHostsForEndpointExpand(inetAddrToString(_addr), _instance->protocolSupport(), true); + if(!interfaces.empty()) { - vector<string> interfaces = - getHostsForEndpointExpand(inetAddrToString(_addr), _instance->protocolSupport(), true); - if(!interfaces.empty()) - { - out << "\nlocal interfaces: "; - for(unsigned int i = 0; i < interfaces.size(); ++i) - { - if(i != 0) - { - out << ", "; - } - out << interfaces[i]; - } - } + out << "\nlocal interfaces: "; + out << IceUtilInternal::joinString(interfaces, ", "); } } } diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index 30e4f7a8c07..8196391e00b 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -24,6 +24,7 @@ #include <Ice/Network.h> #include <Ice/LocalException.h> #include <Ice/Properties.h> +#include <IceUtil/StringUtil.h> using namespace std; using namespace Ice; @@ -475,7 +476,6 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, const s _traceLevels(instance->traceLevels()), _logger(instance->initializationData().logger), _stats(instance->initializationData().stats), - _protocolSupport(instance->protocolSupport()), _incoming(false), _addr(addr), _connect(true), @@ -515,7 +515,6 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, const s _traceLevels(instance->traceLevels()), _logger(instance->initializationData().logger), _stats(instance->initializationData().stats), - _protocolSupport(instance->protocolSupport()), _incoming(true), _addr(getAddressForServer(host, port, instance->protocolSupport())), _connect(connect), @@ -584,21 +583,12 @@ IceInternal::UdpTransceiver::UdpTransceiver(const InstancePtr& instance, const s Trace out(_logger, _traceLevels->networkCat); out << "starting to receive udp packets\n" << toString(); - if(_traceLevels->network >= 3) + vector<string> interfaces = + getHostsForEndpointExpand(inetAddrToString(_addr), instance->protocolSupport(), true); + if(!interfaces.empty()) { - vector<string> interfaces = getHostsForEndpointExpand(inetAddrToString(_addr), _protocolSupport, true); - if(!interfaces.empty()) - { - out << "\nlocal interfaces: "; - for(unsigned int i = 0; i < interfaces.size(); ++i) - { - if(i != 0) - { - out << ", "; - } - out << interfaces[i]; - } - } + out << "\nlocal interfaces: "; + out << IceUtilInternal::joinString(interfaces, ", "); } } } diff --git a/cpp/src/Ice/UdpTransceiver.h b/cpp/src/Ice/UdpTransceiver.h index df86f0c9e9c..4eb1a14bfbe 100644 --- a/cpp/src/Ice/UdpTransceiver.h +++ b/cpp/src/Ice/UdpTransceiver.h @@ -72,7 +72,6 @@ private: const TraceLevelsPtr _traceLevels; const Ice::LoggerPtr _logger; const Ice::StatsPtr _stats; - const ProtocolSupport _protocolSupport; const bool _incoming; const struct sockaddr_storage _addr; struct sockaddr_storage _mcastAddr; |