diff options
author | Marc Laukien <marc@zeroc.com> | 2001-08-28 23:41:27 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-08-28 23:41:27 +0000 |
commit | 8fc36472ad8108e24b6ce17d792e2e9d715851d2 (patch) | |
tree | b475f95dba2fe9e615ac7b38e80a7861683ac5ae /cpp/src/Ice/Endpoint.cpp | |
parent | fixes (diff) | |
download | ice-8fc36472ad8108e24b6ce17d792e2e9d715851d2.tar.bz2 ice-8fc36472ad8108e24b6ce17d792e2e9d715851d2.tar.xz ice-8fc36472ad8108e24b6ce17d792e2e9d715851d2.zip |
many fixes
Diffstat (limited to 'cpp/src/Ice/Endpoint.cpp')
-rw-r--r-- | cpp/src/Ice/Endpoint.cpp | 69 |
1 files changed, 66 insertions, 3 deletions
diff --git a/cpp/src/Ice/Endpoint.cpp b/cpp/src/Ice/Endpoint.cpp index 2038dbdfb14..833af74472b 100644 --- a/cpp/src/Ice/Endpoint.cpp +++ b/cpp/src/Ice/Endpoint.cpp @@ -19,6 +19,7 @@ #include <Ice/UdpTransceiver.h> #include <Ice/Stream.h> #include <Ice/LocalException.h> +#include <sstream> using namespace std; using namespace Ice; @@ -117,6 +118,12 @@ IceInternal::UnknownEndpoint::streamWrite(Stream* s) const s->write(_rawBytes); } +string +IceInternal::UnknownEndpoint::toString() const +{ + return string(); +} + Short IceInternal::UnknownEndpoint::type() const { @@ -251,7 +258,7 @@ IceInternal::TcpEndpoint::TcpEndpoint(const string& ho, Int po, Int ti) : } IceInternal::TcpEndpoint::TcpEndpoint(const string& str) : - _port(10000), + _port(0), _timeout(-1) { const string delim = " \t\n\r"; @@ -352,6 +359,26 @@ IceInternal::TcpEndpoint::streamWrite(Stream* s) const s->endWriteEncaps(); } +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; + } + return s.str(); +} + Short IceInternal::TcpEndpoint::type() const { @@ -551,7 +578,7 @@ IceInternal::SslEndpoint::SslEndpoint(const string& ho, Int po, Int ti) : } IceInternal::SslEndpoint::SslEndpoint(const string& str) : - _port(10000), + _port(0), _timeout(-1) { const string delim = " \t\n\r"; @@ -652,6 +679,26 @@ IceInternal::SslEndpoint::streamWrite(Stream* s) const s->endWriteEncaps(); } +string +IceInternal::SslEndpoint::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; + } + return s.str(); +} + Short IceInternal::SslEndpoint::type() const { @@ -850,7 +897,7 @@ IceInternal::UdpEndpoint::UdpEndpoint(const string& ho, Int po) : } IceInternal::UdpEndpoint::UdpEndpoint(const string& str) : - _port(10000) + _port(0) { const string delim = " \t\n\r"; @@ -941,6 +988,22 @@ IceInternal::UdpEndpoint::streamWrite(Stream* s) const s->endWriteEncaps(); } +string +IceInternal::UdpEndpoint::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; + } + return s.str(); +} + Short IceInternal::UdpEndpoint::type() const { |