diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-10-21 17:02:37 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-10-21 17:02:37 +0200 |
commit | a80b3c8cbb203c78b061e99e1a764685af4a93e9 (patch) | |
tree | 5448b1dd66499b8fc9e46c618aa65b6687855946 /cpp/src/IceSSL/EndpointI.cpp | |
parent | Bug 4311 - change Ice::Service::start signature (diff) | |
download | ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.tar.bz2 ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.tar.xz ice-a80b3c8cbb203c78b061e99e1a764685af4a93e9.zip |
- Removed old IceSSL::ConnectionInfo struct, it's now replaced with
IceSSL::NativeConnectionInfo.
- Removed Ice::ConnectionInfo endpoint attribute.
- Added Ice::Connection::getEndpoint() method.
- Added Ice::ConnectionInfo adapterName and incoming attributes.
- Replaced Tcp and Udp prefixes with TCP and UDP in endpoint/info classes.
- Added IPEndpointInfo and IPConnectionInfo intermediate classes.
- Fixed 2058: deprecate ice_hash for Ice.Object & Ice.LocalObject, added ice_getHash
- Fixed bug where Ice::Endpoint comparison would only compare the endpoint object addresses rather than the endpoint attributes like in Java and C#.
- Added ice_getHash implementation for endpoints and cleaned up Reference::hash to use HashUtil.h helper methods.
- Added test/Ice/info and removed endpoint info test from test/Ice/proxy.
Diffstat (limited to 'cpp/src/IceSSL/EndpointI.cpp')
-rw-r--r-- | cpp/src/IceSSL/EndpointI.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/cpp/src/IceSSL/EndpointI.cpp b/cpp/src/IceSSL/EndpointI.cpp index c21db89353c..78c76c10b79 100644 --- a/cpp/src/IceSSL/EndpointI.cpp +++ b/cpp/src/IceSSL/EndpointI.cpp @@ -16,6 +16,7 @@ #include <Ice/BasicStream.h> #include <Ice/LocalException.h> #include <Ice/DefaultsAndOverrides.h> +#include <Ice/HashUtil.h> using namespace std; using namespace Ice; @@ -229,12 +230,12 @@ IceSSL::EndpointI::toString() const Ice::EndpointInfoPtr IceSSL::EndpointI::getInfo() const { - class InfoI : public IceSSL::SSLEndpointInfo + class InfoI : public IceSSL::EndpointInfo { public: InfoI(Ice::Int to, bool comp, const string& host, Ice::Int port) : - SSLEndpointInfo(to, comp, host, port) + EndpointInfo(to, comp, host, port) { } @@ -387,7 +388,7 @@ IceSSL::EndpointI::equivalent(const IceInternal::EndpointIPtr& endpoint) const } bool -IceSSL::EndpointI::operator==(const IceInternal::EndpointI& r) const +IceSSL::EndpointI::operator==(const Ice::LocalObject& r) const { const EndpointI* p = dynamic_cast<const EndpointI*>(&r); if(!p) @@ -429,18 +430,17 @@ IceSSL::EndpointI::operator==(const IceInternal::EndpointI& r) const } bool -IceSSL::EndpointI::operator!=(const IceInternal::EndpointI& r) const -{ - return !operator==(r); -} - -bool -IceSSL::EndpointI::operator<(const IceInternal::EndpointI& r) const +IceSSL::EndpointI::operator<(const Ice::LocalObject& r) const { const EndpointI* p = dynamic_cast<const EndpointI*>(&r); if(!p) { - return type() < r.type(); + const IceInternal::EndpointI* e = dynamic_cast<const IceInternal::EndpointI*>(&r); + if(!e) + { + return false; + } + return type() < e->type(); } if(this == p) @@ -496,6 +496,18 @@ IceSSL::EndpointI::operator<(const IceInternal::EndpointI& r) const return false; } +Ice::Int +IceSSL::EndpointI::hashInit() const +{ + Ice::Int h = 0; + IceInternal::hashAdd(h, _host); + IceInternal::hashAdd(h, _port); + IceInternal::hashAdd(h, _timeout); + IceInternal::hashAdd(h, _connectionId); + IceInternal::hashAdd(h, _compress); + return h; +} + vector<IceInternal::ConnectorPtr> IceSSL::EndpointI::connectors(const vector<struct sockaddr_storage>& addresses) const { |