diff options
Diffstat (limited to 'cppe/src/TcpTransport/TcpEndpoint.cpp')
-rw-r--r-- | cppe/src/TcpTransport/TcpEndpoint.cpp | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/cppe/src/TcpTransport/TcpEndpoint.cpp b/cppe/src/TcpTransport/TcpEndpoint.cpp index 96f6caf1cb0..85f6ef4d556 100644 --- a/cppe/src/TcpTransport/TcpEndpoint.cpp +++ b/cppe/src/TcpTransport/TcpEndpoint.cpp @@ -33,7 +33,7 @@ IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& { } -IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& str, bool adapterEndp) : +IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& str) : _instance(instance), _port(0), _timeout(-1), @@ -137,17 +137,10 @@ IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& const_cast<string&>(_host) = _instance->defaultsAndOverrides()->defaultHost; if(_host.empty()) { - if(adapterEndp) - { - const_cast<string&>(_host) = "0.0.0.0"; - } - else - { - const_cast<string&>(_host) = getLocalHost(true); - } + const_cast<string&>(_host) = "0.0.0.0"; } } - else if(_host == "*" && adapterEndp) + else if(_host == "*") { const_cast<string&>(_host) = "0.0.0.0"; } @@ -355,18 +348,8 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const return false; } -#ifndef ICEE_PURE_CLIENT - -AcceptorPtr -IceInternal::TcpEndpoint::acceptor(EndpointPtr& endp) const -{ - Acceptor* p = new Acceptor(_instance, _host, _port); - endp = new TcpEndpoint(_instance, _host, p->effectivePort(), _timeout, _publish); - return p; -} - vector<EndpointPtr> -IceInternal::TcpEndpoint::expand() const +IceInternal::TcpEndpoint::expand(bool includeLoopback) const { vector<EndpointPtr> endps; if(_host == "0.0.0.0") @@ -374,8 +357,11 @@ IceInternal::TcpEndpoint::expand() const vector<string> hosts = getLocalHosts(); for(unsigned int i = 0; i < hosts.size(); ++i) { - endps.push_back(new TcpEndpoint(_instance, hosts[i], _port, _timeout, - hosts.size() == 1 || hosts[i] != "127.0.0.1")); + if(includeLoopback || hosts.size() == 1 || hosts[i] != "127.0.0.1") + { + endps.push_back(new TcpEndpoint(_instance, hosts[i], _port, _timeout, + hosts.size() == 1 || hosts[i] != "127.0.0.1")); + } } } else @@ -385,6 +371,16 @@ IceInternal::TcpEndpoint::expand() const return endps; } +#ifndef ICEE_PURE_CLIENT + +AcceptorPtr +IceInternal::TcpEndpoint::acceptor(EndpointPtr& endp) const +{ + Acceptor* p = new Acceptor(_instance, _host, _port); + endp = new TcpEndpoint(_instance, _host, p->effectivePort(), _timeout, _publish); + return p; +} + bool IceInternal::TcpEndpoint::publish() const { |