summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/EndpointI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-10-21 17:02:37 +0200
committerBenoit Foucher <benoit@zeroc.com>2009-10-21 17:02:37 +0200
commita80b3c8cbb203c78b061e99e1a764685af4a93e9 (patch)
tree5448b1dd66499b8fc9e46c618aa65b6687855946 /cpp/src/Ice/EndpointI.cpp
parentBug 4311 - change Ice::Service::start signature (diff)
downloadice-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/Ice/EndpointI.cpp')
-rw-r--r--cpp/src/Ice/EndpointI.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/cpp/src/Ice/EndpointI.cpp b/cpp/src/Ice/EndpointI.cpp
index 64c6efa5cf2..9bfa1516065 100644
--- a/cpp/src/Ice/EndpointI.cpp
+++ b/cpp/src/Ice/EndpointI.cpp
@@ -13,13 +13,50 @@
#include <Ice/Network.h>
#include <Ice/PropertiesI.h>
#include <Ice/LoggerUtil.h>
+#include <IceUtil/MutexPtrLock.h>
using namespace std;
using namespace IceInternal;
+namespace
+{
+
+IceUtil::Mutex* hashMutex = 0;
+
+class Init
+{
+public:
+
+ Init()
+ {
+ hashMutex = new IceUtil::Mutex;
+ }
+
+ ~Init()
+ {
+ delete hashMutex;
+ hashMutex = 0;
+ }
+};
+
+Init init;
+
+}
+
Ice::LocalObject* IceInternal::upCast(EndpointI* p) { return p; }
IceUtil::Shared* IceInternal::upCast(EndpointHostResolver* p) { return p; }
+Ice::Int
+IceInternal::EndpointI::ice_getHash() const
+{
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(hashMutex);
+ if(!_hashInitialized)
+ {
+ _hashValue = hashInit();
+ }
+ return _hashValue;
+}
+
vector<ConnectorPtr>
IceInternal::EndpointI::connectors(const vector<struct sockaddr_storage>& addrs) const
{
@@ -31,6 +68,10 @@ IceInternal::EndpointI::connectors(const vector<struct sockaddr_storage>& addrs)
return vector<ConnectorPtr>();
}
+IceInternal::EndpointI::EndpointI() : _hashInitialized(false)
+{
+}
+
IceInternal::EndpointHostResolver::EndpointHostResolver(const InstancePtr& instance) :
IceUtil::Thread("Ice endpoint host resolver thread"),
_instance(instance),