diff options
author | Marc Laukien <marc@zeroc.com> | 2001-12-06 20:50:34 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-12-06 20:50:34 +0000 |
commit | 69ab9df0b58233ca893407b0ef9fae5376413c06 (patch) | |
tree | 6806c4360e50f519a6cf085e78ad81c503bba932 /cpp/src/Ice/Endpoint.cpp | |
parent | default protocol (diff) | |
download | ice-69ab9df0b58233ca893407b0ef9fae5376413c06.tar.bz2 ice-69ab9df0b58233ca893407b0ef9fae5376413c06.tar.xz ice-69ab9df0b58233ca893407b0ef9fae5376413c06.zip |
Ice.DefaultHost, Ice.DefaultProtocol
Diffstat (limited to 'cpp/src/Ice/Endpoint.cpp')
-rw-r--r-- | cpp/src/Ice/Endpoint.cpp | 47 |
1 files changed, 6 insertions, 41 deletions
diff --git a/cpp/src/Ice/Endpoint.cpp b/cpp/src/Ice/Endpoint.cpp index a5677a81376..ad3590e9645 100644 --- a/cpp/src/Ice/Endpoint.cpp +++ b/cpp/src/Ice/Endpoint.cpp @@ -340,8 +340,7 @@ IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& if (_host.empty()) { - // TODO: Whether numeric or not should be configurable - const_cast<string&>(_host) = getLocalHost(true); + const_cast<string&>(_host) = _instance->defaultHost(); } } @@ -372,19 +371,7 @@ string IceInternal::TcpEndpoint::toString() const { ostringstream s; - s << "tcp"; - if (_host != getLocalHost(true)) // TODO: Whether numeric or not should be configurable - { - s << " -h " << _host; - } - if (_port != 0) - { - s << " -p " << _port; - } - if (_timeout != -1) - { - s << " -t " << _timeout; - } + s << "tcp -h " << _host << " -p " << _port << " -t " << _timeout; return s.str(); } @@ -655,8 +642,7 @@ IceInternal::SslEndpoint::SslEndpoint(const InstancePtr& instance, const string& if (_host.empty()) { - // TODO: Whether numeric or not should be configurable - const_cast<string&>(_host) = getLocalHost(true); + const_cast<string&>(_host) = _instance->defaultHost(); } } @@ -687,19 +673,7 @@ string IceInternal::SslEndpoint::toString() const { ostringstream s; - s << "ssl"; - if (_host != getLocalHost(true)) // TODO: Whether numeric or not should be configurable - { - s << " -h " << _host; - } - if (_port != 0) - { - s << " -p " << _port; - } - if (_timeout != -1) - { - s << " -t " << _timeout; - } + s << "ssl -h " << _host << " -p " << _port << " -t " << _timeout; return s.str(); } @@ -962,8 +936,7 @@ IceInternal::UdpEndpoint::UdpEndpoint(const InstancePtr& instance, const string& if (_host.empty()) { - // TODO: Whether numeric or not should be configurable - const_cast<string&>(_host) = getLocalHost(true); + const_cast<string&>(_host) = _instance->defaultHost(); } } @@ -991,15 +964,7 @@ string IceInternal::UdpEndpoint::toString() const { ostringstream s; - s << "udp"; - if (_host != getLocalHost(true)) // TODO: Whether numeric or not should be configurable - { - s << " -h " << _host; - } - if (_port != 0) - { - s << " -p " << _port; - } + s << "udp -h " << _host << " -p " << _port; return s.str(); } |