diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-06-06 11:39:41 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-06-06 11:39:41 +0200 |
commit | 966061fcb0e2ec4d5d7ed9c6c280eefb27209da7 (patch) | |
tree | 078246631fb864d9e908108d69917b18c6303c16 /cppe/src | |
parent | Removed SL code (diff) | |
download | ice-966061fcb0e2ec4d5d7ed9c6c280eefb27209da7.tar.bz2 ice-966061fcb0e2ec4d5d7ed9c6c280eefb27209da7.tar.xz ice-966061fcb0e2ec4d5d7ed9c6c280eefb27209da7.zip |
Removed Ice-E
Diffstat (limited to 'cppe/src')
96 files changed, 0 insertions, 24860 deletions
diff --git a/cppe/src/IceE/.depend b/cppe/src/IceE/.depend deleted file mode 100644 index e4f39f74d53..00000000000 --- a/cppe/src/IceE/.depend +++ /dev/null @@ -1,65 +0,0 @@ -BasicStream$(OBJEXT): BasicStream.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Properties.h ../../include/IceE/PropertiesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/ProxyFactory.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/LocalException.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/LoggerUtil.h -Buffer$(OBJEXT): Buffer.cpp ../../include/IceE/Buffer.h ../../include/IceE/Config.h ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h -BuiltinSequences$(OBJEXT): BuiltinSequences.cpp ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -Communicator$(OBJEXT): Communicator.cpp ../../include/IceE/Communicator.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/PropertiesF.h ../../include/IceE/InstanceF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Router.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Incoming.h ../../include/IceE/ServantManagerF.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../IceE/Instance.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/Properties.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorF.h ../IceE/ProxyFactory.h ../../include/IceE/LoggerUtil.h ../../include/IceE/LocalException.h ../IceE/ObjectAdapterFactory.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h -Cond$(OBJEXT): Cond.cpp ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Config.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -Connection$(OBJEXT): Connection.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Connection.h ../../include/IceE/ConnectionF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Incoming.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/Current.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ReferenceF.h ../../include/IceE/Outgoing.h ../../include/IceE/LoggerUtil.h ../../include/IceE/Properties.h ../IceE/TraceUtil.h ../IceE/DefaultsAndOverrides.h ../IceE/Transceiver.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../IceE/AcceptorF.h ../../include/IceE/LocalException.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/LocatorF.h ../IceE/ProxyFactory.h ../IceE/TraceLevels.h -ConvertUTF$(OBJEXT): ConvertUTF.cpp ../../include/IceE/Config.h ../IceE/ConvertUTF.h ../../include/IceE/Unicode.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -Current$(OBJEXT): Current.cpp ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h -DefaultsAndOverrides$(OBJEXT): DefaultsAndOverrides.cpp ../IceE/DefaultsAndOverrides.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/PropertiesF.h ../../include/IceE/Properties.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Network.h -Endpoint$(OBJEXT): Endpoint.cpp ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../IceE/AcceptorF.h -ExceptionBase$(OBJEXT): ExceptionBase.cpp ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/SafeStdio.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h -FactoryTable$(OBJEXT): FactoryTable.cpp ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Mutex.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/Shared.h -FactoryTableDef$(OBJEXT): FactoryTableDef.cpp ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Mutex.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/Shared.h -Identity$(OBJEXT): Identity.cpp ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ConnectionF.h ../../include/IceE/OperationMode.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -Incoming$(OBJEXT): Incoming.cpp ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../IceE/ServantManager.h ../../include/IceE/ObjectAdapter.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Outgoing.h ../../include/IceE/Object.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/RecMutex.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../IceE/ReplyStatus.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Thread.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/Properties.h ../../include/IceE/LoggerUtil.h ../../include/IceE/StringUtil.h -IncomingConnectionFactory$(OBJEXT): IncomingConnectionFactory.cpp ../IceE/IncomingConnectionFactory.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/EndpointF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/InstanceF.h ../IceE/AcceptorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/Incoming.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Current.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ReferenceF.h ../../include/IceE/Outgoing.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../IceE/DefaultsAndOverrides.h ../../include/IceE/Properties.h ../IceE/Transceiver.h ../IceE/Acceptor.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/LocalException.h ../../include/IceE/Functional.h -Initialize$(OBJEXT): Initialize.cpp ../../include/IceE/Initialize.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/PropertiesF.h ../../include/IceE/LoggerF.h ../../include/IceE/InstanceF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Communicator.h ../../include/IceE/RecMutex.h ../../include/IceE/Properties.h ../../include/IceE/LocalException.h -Instance$(OBJEXT): Instance.cpp ../../include/IceE/DisableWarnings.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../IceE/DefaultsAndOverrides.h ../IceE/RouterInfo.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/EndpointF.h ../../include/IceE/Router.h ../../include/IceE/Incoming.h ../../include/IceE/ServantManagerF.h ../IceE/LocatorInfo.h ../../include/IceE/LocatorF.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../IceE/ProxyFactory.h ../IceE/OutgoingConnectionFactory.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/LocalException.h ../../include/IceE/Properties.h ../IceE/LoggerI.h ../../include/IceE/Logger.h ../IceE/EndpointFactory.h ../IceE/ObjectAdapterFactory.h ../../include/IceE/StringUtil.h -LocalException$(OBJEXT): LocalException.cpp ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/SafeStdio.h ../../include/IceE/StringUtil.h ../IceE/Network.h -Locator$(OBJEXT): Locator.cpp ../../include/IceE/Locator.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -LocatorInfo$(OBJEXT): LocatorInfo.cpp ../../include/IceE/Config.h ../IceE/LocatorInfo.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Shared.h ../../include/IceE/LocatorF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/EndpointF.h ../../include/IceE/Locator.h ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/AcceptorF.h ../IceE/Reference.h ../../include/IceE/RouterF.h ../../include/IceE/Functional.h -Logger$(OBJEXT): Logger.cpp ../../include/IceE/Logger.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h -LoggerI$(OBJEXT): LoggerI.cpp ../IceE/LoggerI.h ../../include/IceE/Logger.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/StaticMutex.h -LoggerUtil$(OBJEXT): LoggerUtil.cpp ../../include/IceE/LoggerUtil.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Logger.h -Network$(OBJEXT): Network.cpp ../../include/IceE/StaticMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../IceE/Network.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/SafeStdio.h -Object$(OBJEXT): Object.cpp ../../include/IceE/Object.h ../../include/IceE/ObjectF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ConnectionF.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Outgoing.h ../../include/IceE/SafeStdio.h -ObjectAdapter$(OBJEXT): ObjectAdapter.cpp ../../include/IceE/ObjectAdapter.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/RecMutex.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../IceE/ObjectAdapterFactory.h ../../include/IceE/UUID.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../IceE/ProxyFactory.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../IceE/EndpointFactory.h ../IceE/IncomingConnectionFactory.h ../IceE/AcceptorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/Thread.h ../IceE/OutgoingConnectionFactory.h ../IceE/ServantManager.h ../../include/IceE/LocalException.h ../../include/IceE/Properties.h ../../include/IceE/Functional.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/Incoming.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h -ObjectAdapterFactory$(OBJEXT): ObjectAdapterFactory.cpp ../IceE/ObjectAdapterFactory.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/InstanceF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/ObjectAdapter.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/RecMutex.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Functional.h -OperationMode$(OBJEXT): OperationMode.cpp ../../include/IceE/OperationMode.h ../../include/IceE/Config.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/Shared.h -Outgoing$(OBJEXT): Outgoing.cpp ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/ReplyStatus.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Incoming.h ../../include/IceE/Current.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../IceE/Reference.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/Initialize.h -OutgoingConnectionFactory$(OBJEXT): OutgoingConnectionFactory.cpp ../IceE/OutgoingConnectionFactory.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/InstanceF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Connection.h ../../include/IceE/TransceiverF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Incoming.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Current.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Thread.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ReferenceF.h ../../include/IceE/Outgoing.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../IceE/DefaultsAndOverrides.h ../IceE/Connector.h ../IceE/ConnectorF.h ../IceE/Endpoint.h ../IceE/AcceptorF.h ../IceE/RouterInfo.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/LocalException.h ../../include/IceE/Functional.h ../IceE/Reference.h ../../include/IceE/LocatorF.h -Properties$(OBJEXT): Properties.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Properties.h ../../include/IceE/PropertiesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/StringUtil.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/InstanceF.h ../../include/IceE/LocalException.h -Protocol$(OBJEXT): Protocol.cpp ../../include/IceE/Protocol.h ../../include/IceE/Config.h -Proxy$(OBJEXT): Proxy.cpp ../../include/IceE/Communicator.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/PropertiesF.h ../../include/IceE/InstanceF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/ProxyFactory.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Incoming.h ../../include/IceE/Current.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../IceE/Reference.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../IceE/Instance.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/LocalException.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h -ProxyFactory$(OBJEXT): ProxyFactory.cpp ../IceE/ProxyFactory.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/ReferenceF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Thread.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Time.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Reference.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/LocatorF.h ../IceE/ReferenceFactory.h ../IceE/LocatorInfo.h ../../include/IceE/Properties.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../../include/IceE/LocalException.h ../../include/IceE/SafeStdio.h -RecMutex$(OBJEXT): RecMutex.cpp ../../include/IceE/RecMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -Reference$(OBJEXT): Reference.cpp ../IceE/Reference.h ../../include/IceE/ReferenceF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../IceE/ReferenceFactory.h ../IceE/ReferenceFactoryF.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/AcceptorF.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../../include/IceE/Incoming.h ../../include/IceE/ServantManagerF.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/Connection.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Functional.h ../IceE/OutgoingConnectionFactory.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../../include/IceE/StringUtil.h -ReferenceFactory$(OBJEXT): ReferenceFactory.cpp ../IceE/ReferenceFactory.h ../IceE/ReferenceFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../IceE/Reference.h ../../include/IceE/ReferenceF.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/AcceptorF.h ../IceE/EndpointFactory.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../../include/IceE/Incoming.h ../../include/IceE/ServantManagerF.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/StringUtil.h ../../include/IceE/LoggerUtil.h ../../include/IceE/Properties.h ../../include/IceE/Communicator.h -Router$(OBJEXT): Router.cpp ../../include/IceE/Router.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/ObjectF.h ../../include/IceE/Shared.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/LocalException.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -RouterInfo$(OBJEXT): RouterInfo.cpp ../../include/IceE/Config.h ../IceE/RouterInfo.h ../../include/IceE/RouterInfoF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Shared.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/EndpointF.h ../../include/IceE/Router.h ../../include/IceE/Incoming.h ../../include/IceE/InstanceF.h ../../include/IceE/ServantManagerF.h ../../include/IceE/BuiltinSequences.h ../IceE/Reference.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../../include/IceE/LocalException.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Functional.h -SafeStdio$(OBJEXT): SafeStdio.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/SafeStdio.h ../../include/IceE/Config.h -ServantManager$(OBJEXT): ServantManager.cpp ../IceE/ServantManager.h ../../include/IceE/ServantManagerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/ObjectAdapter.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/IncomingConnectionFactoryF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Object.h ../../include/IceE/Current.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/RecMutex.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/StringUtil.h -Shared$(OBJEXT): Shared.cpp ../../include/IceE/Shared.h ../../include/IceE/Config.h -StaticMutex$(OBJEXT): StaticMutex.cpp ../../include/IceE/StaticMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -StringConverter$(OBJEXT): StringConverter.cpp ../../include/IceE/Config.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../../include/IceE/Shared.h ../../include/IceE/Unicode.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h -StringUtil$(OBJEXT): StringUtil.cpp ../../include/IceE/StringUtil.h ../../include/IceE/Config.h ../../include/IceE/ExceptionBase.h -Thread$(OBJEXT): Thread.cpp ../../include/IceE/Thread.h ../../include/IceE/Shared.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Time.h -ThreadException$(OBJEXT): ThreadException.cpp ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/SafeStdio.h -Time$(OBJEXT): Time.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Time.h ../../include/IceE/Config.h -TraceLevels$(OBJEXT): TraceLevels.cpp ../IceE/TraceLevels.h ../../include/IceE/Shared.h ../../include/IceE/Config.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/PropertiesF.h ../../include/IceE/Properties.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h -TraceUtil$(OBJEXT): TraceUtil.cpp ../IceE/TraceUtil.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/StringUtil.h ../IceE/ReplyStatus.h ../IceE/TraceLevels.h ../../include/IceE/PropertiesF.h ../../include/IceE/Logger.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/SafeStdio.h ../../include/IceE/OperationMode.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Outgoing.h -UnknownEndpoint$(OBJEXT): UnknownEndpoint.cpp ../IceE/UnknownEndpoint.h ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../IceE/AcceptorF.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h -Unicode$(OBJEXT): Unicode.cpp ../../include/IceE/Config.h ../../include/IceE/Unicode.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../IceE/ConvertUTF.h -UUID$(OBJEXT): UUID.cpp ../../include/IceE/Config.h ../../include/IceE/UUID.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h -Acceptor$(OBJEXT): ../../src/TcpTransport/Acceptor.cpp ../IceE/Acceptor.h ../../include/IceE/TransceiverF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/AcceptorF.h ../IceE/Transceiver.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Network.h -Connector$(OBJEXT): ../../src/TcpTransport/Connector.cpp ../IceE/Connector.h ../IceE/ConnectorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Transceiver.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Network.h -EndpointFactory$(OBJEXT): ../../src/TcpTransport/EndpointFactory.cpp ../IceE/EndpointFactory.h ../IceE/EndpointFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../IceE/UnknownEndpoint.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/AcceptorF.h ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../TcpTransport/TcpEndpoint.h -TcpEndpoint$(OBJEXT): ../../src/TcpTransport/TcpEndpoint.cpp ../TcpTransport/TcpEndpoint.h ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../IceE/AcceptorF.h ../IceE/Network.h ../IceE/Connector.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Transceiver.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../IceE/DefaultsAndOverrides.h ../../include/IceE/SafeStdio.h ../IceE/Acceptor.h -Transceiver$(OBJEXT): ../../src/TcpTransport/Transceiver.cpp ../IceE/Transceiver.h ../../include/IceE/TransceiverF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/ObjectAdapterFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ObjectF.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Network.h ../../include/IceE/LocalException.h ../../include/IceE/SafeStdio.h -BuiltinSequences.cpp: ../../slice/IceE/BuiltinSequences.ice -Identity.cpp: ../../slice/IceE/Identity.ice -LocatorF.cpp: ../../slice/IceE/LocatorF.ice -Locator.cpp: ../../slice/IceE/Locator.ice ../../slice/IceE/Identity.ice -RouterF.cpp: ../../slice/IceE/RouterF.ice -Router.cpp: ../../slice/IceE/Router.ice ../../slice/IceE/BuiltinSequences.ice diff --git a/cppe/src/IceE/.gitignore b/cppe/src/IceE/.gitignore deleted file mode 100644 index cd2d8983678..00000000000 --- a/cppe/src/IceE/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by makegitignore.py - -// IMPORTANT: Do not edit this file -- any edits made here will be lost! -BuiltinSequences.cpp -Identity.cpp -LocatorF.cpp -Locator.cpp -RouterF.cpp -Router.cpp -BuiltinSequences.h -Identity.h -LocatorF.h -Locator.h -RouterF.h -Router.h diff --git a/cppe/src/IceE/Acceptor.h b/cppe/src/IceE/Acceptor.h deleted file mode 100644 index ed92f83eaa3..00000000000 --- a/cppe/src/IceE/Acceptor.h +++ /dev/null @@ -1,63 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ACCEPTOR_H -#define ICEE_ACCEPTOR_H - -#include <IceE/TransceiverF.h> -#include <IceE/InstanceF.h> -#include <IceE/TraceLevelsF.h> -#include <IceE/LoggerF.h> -#include <IceE/AcceptorF.h> - -#include <IceE/Shared.h> - -#ifdef _WIN32 -# include <winsock2.h> -typedef int ssize_t; -#else -# define SOCKET int -# include <netinet/in.h> // For struct sockaddr_in -#endif - -namespace IceInternal -{ - -class Endpoint; - -class Acceptor : public ::IceUtil::Shared -{ -public: - - SOCKET fd(); - void close(); - void listen(); - TransceiverPtr accept(); - void connectToSelf(); - std::string toString() const; - - int effectivePort(); - -private: - - Acceptor(const InstancePtr&, const std::string&, int); - virtual ~Acceptor(); - friend class TcpEndpoint; - - InstancePtr _instance; - TraceLevelsPtr _traceLevels; - ::Ice::LoggerPtr _logger; - SOCKET _fd; - int _backlog; - struct sockaddr_in _addr; -}; - -} - -#endif diff --git a/cppe/src/IceE/AcceptorF.h b/cppe/src/IceE/AcceptorF.h deleted file mode 100644 index 4a0be123d9f..00000000000 --- a/cppe/src/IceE/AcceptorF.h +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ACCEPTOR_F_H -#define ICEE_ACCEPTOR_F_H - -#include <IceE/Handle.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class Acceptor; -IceUtil::Shared* upCast(Acceptor*); -typedef Handle<Acceptor> AcceptorPtr; - -} - -#endif diff --git a/cppe/src/IceE/Base64.cpp b/cppe/src/IceE/Base64.cpp deleted file mode 100644 index d9163c066d8..00000000000 --- a/cppe/src/IceE/Base64.cpp +++ /dev/null @@ -1,268 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Base64.h> - -using namespace std; - -string -IceUtil::Base64::encode(const vector<unsigned char>& plainSeq) -{ - string retval; - - if(plainSeq.size() == 0) - { - return retval; - } - - // Reserve enough space for the returned base64 string - size_t base64Bytes = (((plainSeq.size() * 4) / 3) + 1); - size_t newlineBytes = (((base64Bytes * 2) / 76) + 1); - size_t totalBytes = base64Bytes + newlineBytes; - - retval.reserve(totalBytes); - - unsigned char by1 = 0; - unsigned char by2 = 0; - unsigned char by3 = 0; - unsigned char by4 = 0; - unsigned char by5 = 0; - unsigned char by6 = 0; - unsigned char by7 = 0; - - for(size_t i = 0; i < plainSeq.size(); i += 3) - { - by1 = plainSeq[i]; - by2 = 0; - by3 = 0; - - if((i + 1) < plainSeq.size()) - { - by2 = plainSeq[i+1]; - } - - if((i + 2) < plainSeq.size()) - { - by3 = plainSeq[i+2]; - } - - by4 = by1 >> 2; - by5 = ((by1 & 0x3) << 4) | (by2 >> 4); - by6 = ((by2 & 0xf) << 2) | (by3 >> 6); - by7 = by3 & 0x3f; - - retval += encode(by4); - retval += encode(by5); - - if((i + 1) < plainSeq.size()) - { - retval += encode(by6); - } - else - { - retval += "="; - } - - if((i + 2) < plainSeq.size()) - { - retval += encode(by7); - } - else - { - retval += "="; - } - } - - string outString; - outString.reserve(totalBytes); - string::iterator iter = retval.begin(); - - while((retval.end() - iter) > 76) - { - copy(iter, iter+76, back_inserter(outString)); - outString += "\r\n"; - iter += 76; - } - - copy(iter, retval.end(), back_inserter(outString)); - - return outString; -} - -vector<unsigned char> -IceUtil::Base64::decode(const string& str) -{ - string newStr; - - newStr.reserve(str.length()); - - for(size_t j = 0; j < str.length(); j++) - { - if(isBase64(str[j])) - { - newStr += str[j]; - } - } - - vector<unsigned char> retval; - - if(newStr.length() == 0) - { - return retval; - } - - // Note: This is how we were previously computing the size of the return - // sequence. The method below is more efficient (and correct). - // size_t lines = str.size() / 78; - // size_t totalBytes = (lines * 76) + (((str.size() - (lines * 78)) * 3) / 4); - - // Figure out how long the final sequence is going to be. - size_t totalBytes = (newStr.size() * 3 / 4) + 1; - - retval.reserve(totalBytes); - - unsigned char by1 = 0; - unsigned char by2 = 0; - unsigned char by3 = 0; - unsigned char by4 = 0; - - char c1, c2, c3, c4; - - for(size_t i = 0; i < newStr.length(); i += 4) - { - c1 = 'A'; - c2 = 'A'; - c3 = 'A'; - c4 = 'A'; - - c1 = newStr[i]; - - if((i + 1) < newStr.length()) - { - c2 = newStr[i + 1]; - } - - if((i + 2) < newStr.length()) - { - c3 = newStr[i + 2]; - } - - if((i + 3) < newStr.length()) - { - c4 = newStr[i + 3]; - } - - by1 = decode(c1); - by2 = decode(c2); - by3 = decode(c3); - by4 = decode(c4); - - retval.push_back((by1 << 2) | (by2 >> 4)); - - if(c3 != '=') - { - retval.push_back(((by2 & 0xf) << 4) | (by3 >> 2)); - } - - if(c4 != '=') - { - retval.push_back(((by3 & 0x3) << 6) | by4); - } - } - - return retval; -} - -bool -IceUtil::Base64::isBase64(char c) -{ - if(c >= 'A' && c <= 'Z') - { - return true; - } - - if(c >= 'a' && c <= 'z') - { - return true; - } - - if(c >= '0' && c <= '9') - { - return true; - } - - if(c == '+') - { - return true; - } - - if(c == '/') - { - return true; - } - - if(c == '=') - { - return true; - } - - return false; -} - -char -IceUtil::Base64::encode(unsigned char uc) -{ - if(uc < 26) - { - return 'A' + uc; - } - - if(uc < 52) - { - return 'a' + (uc - 26); - } - - if(uc < 62) - { - return '0' + (uc - 52); - } - - if(uc == 62) - { - return '+'; - } - - return '/'; -} - -unsigned char -IceUtil::Base64::decode(char c) -{ - if(c >= 'A' && c <= 'Z') - { - return c - 'A'; - } - - if(c >= 'a' && c <= 'z') - { - return c - 'a' + 26; - } - - if(c >= '0' && c <= '9') - { - return c - '0' + 52; - } - - if(c == '+') - { - return 62; - } - - return 63; -} diff --git a/cppe/src/IceE/BasicStream.cpp b/cppe/src/IceE/BasicStream.cpp deleted file mode 100644 index d653a6256c3..00000000000 --- a/cppe/src/IceE/BasicStream.cpp +++ /dev/null @@ -1,1573 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/Properties.h> -#include <IceE/BasicStream.h> -#include <IceE/Instance.h> -#include <IceE/ProxyFactory.h> -#include <IceE/UserExceptionFactory.h> -#include <IceE/LocalException.h> -#include <IceE/Protocol.h> -#include <IceE/FactoryTable.h> -#include <IceE/LoggerUtil.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -void -IceInternal::BasicStream::clear() -{ - while(_currentReadEncaps && _currentReadEncaps != &_preAllocatedReadEncaps) - { - ReadEncaps* oldEncaps = _currentReadEncaps; - _currentReadEncaps = _currentReadEncaps->previous; - delete oldEncaps; - } - - while(_currentWriteEncaps && _currentWriteEncaps != &_preAllocatedWriteEncaps) - { - WriteEncaps* oldEncaps = _currentWriteEncaps; - _currentWriteEncaps = _currentWriteEncaps->previous; - delete oldEncaps; - } - - while(_seqDataStack) - { - SeqData* oldSeqData = _seqDataStack; - _seqDataStack = _seqDataStack->previous; - delete oldSeqData; - } -} - -void -IceInternal::BasicStream::swap(BasicStream& other) -{ - assert(_instance == other._instance); - - Buffer::swap(other); - - // - // Swap is never called for BasicStreams that have more than one - // encaps. - // - assert(!_currentReadEncaps || _currentReadEncaps == &_preAllocatedReadEncaps); - assert(!_currentWriteEncaps || _currentWriteEncaps == &_preAllocatedWriteEncaps); - assert(!other._currentReadEncaps || other._currentReadEncaps == &other._preAllocatedReadEncaps); - assert(!other._currentWriteEncaps || other._currentWriteEncaps == &other._preAllocatedWriteEncaps); - - if(_currentReadEncaps || other._currentReadEncaps) - { - _preAllocatedReadEncaps.swap(other._preAllocatedReadEncaps); - - if(!_currentReadEncaps) - { - _currentReadEncaps = &_preAllocatedReadEncaps; - other._currentReadEncaps = 0; - } - else if(!other._currentReadEncaps) - { - other._currentReadEncaps = &other._preAllocatedReadEncaps; - _currentReadEncaps = 0; - } - } - - if(_currentWriteEncaps || other._currentWriteEncaps) - { - _preAllocatedWriteEncaps.swap(other._preAllocatedWriteEncaps); - - if(!_currentWriteEncaps) - { - _currentWriteEncaps = &_preAllocatedWriteEncaps; - other._currentWriteEncaps = 0; - } - else if(!other._currentWriteEncaps) - { - other._currentWriteEncaps = &other._preAllocatedWriteEncaps; - _currentWriteEncaps = 0; - } - } - - std::swap(_seqDataStack, other._seqDataStack); - std::swap(_unlimited, other._unlimited); -} - -// -// startSeq() and endSeq() sanity-check sequence sizes during -// unmarshaling and prevent malicious messages with incorrect sequence -// sizes from causing the receiver to use up all available memory by -// allocating sequences with an impossibly large number of elements. -// -// The code generator inserts calls to startSeq() and endSeq() around -// the code to unmarshal a sequence of a variable-length type. startSeq() -// is called immediately after reading the sequence size, and endSeq() is -// called after reading the final element of a sequence. -// -// For a sequence of a fixed-length type, the code generator inserts a -// call to checkFixedSeq(), which does not cause any memory allocations. -// -// For sequences that contain constructed types that, in turn, contain -// sequences, the code generator also inserts a call to endElement() -// (inlined in BasicStream.h) after unmarshaling each element. -// -// startSeq() is passed the unmarshaled element count, plus the -// minimum size (in bytes) occupied by the sequence's element -// type. numElements * minSize is the smallest possible number of -// bytes that the sequence will occupy on the wire. -// -// Every time startSeq() is called, it pushes the element count and -// the minimum size on a stack. Every time endSeq() is called, it pops -// the stack. -// -// For an ordinary sequence (one that does not (recursively) contain -// nested sequences), numElements * minSize must be less than the -// number of bytes remaining in the stream. -// -// For a sequence that is nested within some other sequence, there -// must be enough bytes remaining in the stream for this sequence -// (numElements + minSize), plus the sum of the bytes required by the -// remaining elements of all the enclosing sequences. -// -// For the enclosing sequences, numElements - 1 is the number of -// elements for which unmarshaling has not started yet. (The call to -// endElement() in the generated code decrements that number whenever -// a sequence element is unmarshaled.) -// -// For sequences that have variable-length elements, checkSeq() is called -// whenever an element is unmarshaled. checkSeq() also checks whether -// the stream has a sufficient number of bytes remaining. This means -// that, for messages with bogus sequence sizes, unmarshaling is -// aborted at the earliest possible point. -// - -void -IceInternal::BasicStream::startSeq(int numElements, int minSize) -{ - if(numElements == 0) // Optimization to avoid pushing a useless stack frame. - { - return; - } - - // - // Push the current sequence details on the stack. - // - SeqData* sd = new SeqData(numElements, minSize); - sd->previous = _seqDataStack; - _seqDataStack = sd; - - int bytesLeft = static_cast<int>(b.end() - i); - if(_seqDataStack->previous == 0) // Outermost sequence - { - // - // The sequence must fit within the message. - // - if(numElements * minSize > bytesLeft) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - } - else // Nested sequence - { - checkSeq(bytesLeft); - } -} - -void -IceInternal::BasicStream::checkFixedSeq(int numElements, int elemSize) -{ - int bytesLeft = static_cast<int>(b.end() - i); - if(_seqDataStack == 0) // Outermost sequence - { - // - // The sequence must fit within the message. - // - if(numElements * elemSize > bytesLeft) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - } - else // Nested sequence - { - checkSeq(bytesLeft - numElements * elemSize); - } -} - -void -IceInternal::BasicStream::endSeq(int sz) -{ - if(sz == 0) // Pop only if something was pushed previously. - { - return; - } - - // - // Pop the sequence stack. - // - SeqData* oldSeqData = _seqDataStack; - assert(oldSeqData); - _seqDataStack = oldSeqData->previous; - delete oldSeqData; -} - -void -IceInternal::BasicStream::WriteEncaps::swap(WriteEncaps& other) -{ - std::swap(start, other.start); - - std::swap(writeIndex, other.writeIndex); - std::swap(previous, other.previous); -} - -void -IceInternal::BasicStream::ReadEncaps::swap(ReadEncaps& other) -{ - std::swap(start, other.start); - std::swap(sz, other.sz); - - std::swap(encodingMajor, other.encodingMajor); - std::swap(encodingMinor, other.encodingMinor); - - std::swap(previous, other.previous); -} - -Int -IceInternal::BasicStream::getReadEncapsSize() -{ - assert(_currentReadEncaps); - return _currentReadEncaps->sz - static_cast<Int>(sizeof(Int)) - 2; -} - -void -IceInternal::BasicStream::skipEncaps() -{ - Int sz; - read(sz); - if(sz < 0) - { - throwNegativeSizeException(__FILE__, __LINE__); - } - if(i - sizeof(Int) + sz > b.end()) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - i += sz - sizeof(Int); -} - -void -IceInternal::BasicStream::startWriteSlice() -{ - write(Int(0)); // Placeholder for the slice length. - _writeSlice = b.size(); -} - -void -IceInternal::BasicStream::endWriteSlice() -{ - Int sz = static_cast<Int>(b.size() - _writeSlice + sizeof(Int)); - Byte* dest = &(*(b.begin() + _writeSlice - sizeof(Int))); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&sz); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::startReadSlice() -{ - Int sz; - read(sz); - if(sz < 0) - { - throwNegativeSizeException(__FILE__, __LINE__); - } - _readSlice = i - b.begin(); -} - -void -IceInternal::BasicStream::endReadSlice() -{ -} - -void -IceInternal::BasicStream::skipSlice() -{ - Int sz; - read(sz); - if(sz < 0) - { - throwNegativeSizeException(__FILE__, __LINE__); - } - i += sz - sizeof(Int); - if(i > b.end()) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } -} - -void -IceInternal::BasicStream::writeBlob(const vector<Byte>& v) -{ - if(!v.empty()) - { - Container::size_type pos = b.size(); - resize(pos + v.size()); - memcpy(&b[pos], &v[0], v.size()); - } -} - -void -IceInternal::BasicStream::readBlob(vector<Byte>& v, Int sz) -{ - if(sz > 0) - { - if(b.end() - i < sz) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - vector<Byte>(i, i + sz).swap(v); - i += sz; - } - else - { - v.clear(); - } -} - -void -IceInternal::BasicStream::read(pair<const Byte*, const Byte*>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, 1); - v.first = i; - v.second = i + sz; - i += sz; - } - else - { - v.first = v.second = i; - } -} - -void -IceInternal::BasicStream::write(const Byte* begin, const Byte* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz); - memcpy(&b[pos], begin, sz); - } -} - -void -IceInternal::BasicStream::write(const vector<bool>& v) -{ - Int sz = static_cast<Int>(v.size()); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz); - copy(v.begin(), v.end(), b.begin() + pos); - } -} - -namespace -{ - -template<size_t boolSize> -struct BasicStreamWriteBoolHelper -{ - static void write(const bool* begin, BasicStream::Container::size_type pos, BasicStream::Container& b, Int sz) - { - for(int idx = 0; idx < sz; ++idx) - { - b[pos + idx] = static_cast<Ice::Byte>(*(begin + idx)); - } - } -}; - -template<> -struct BasicStreamWriteBoolHelper<1> -{ - static void write(const bool* begin, BasicStream::Container::size_type pos, BasicStream::Container& b, Int sz) - { - memcpy(&b[pos], begin, sz); - } -}; - -} - -void -IceInternal::BasicStream::write(const bool* begin, const bool* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz); - BasicStreamWriteBoolHelper<sizeof(bool)>::write(begin, pos, b, sz); - } -} - -void -IceInternal::BasicStream::read(vector<bool>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, 1); - v.resize(sz); - copy(i, i + sz, v.begin()); - i += sz; - } - else - { - v.clear(); - } -} - -namespace -{ - -template<size_t boolSize> -struct BasicStreamReadBoolHelper -{ - static bool* read(pair<const bool*, const bool*>& v, Int sz, BasicStream::Container::iterator& i) - { - bool* array = new bool[sz]; - for(int idx = 0; idx < sz; ++idx) - { - array[idx] = static_cast<bool>(*(i + idx)); - } - v.first = array; - v.second = array + sz; - return array; - } -}; - -template<> -struct BasicStreamReadBoolHelper<1> -{ - static bool* read(pair<const bool*, const bool*>& v, Int sz, BasicStream::Container::iterator& i) - { - v.first = reinterpret_cast<bool*>(i); - v.second = reinterpret_cast<bool*>(i) + sz; - return 0; - } -}; - -} - -bool* -IceInternal::BasicStream::read(pair<const bool*, const bool*>& v) -{ - bool* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, 1); - result = BasicStreamReadBoolHelper<sizeof(bool)>::read(v, sz, i); - i += sz; - } - else - { - v.first = v.second = reinterpret_cast<bool*>(i); - } - return result; -} - -void -IceInternal::BasicStream::write(Short v) -{ - Container::size_type pos = b.size(); - resize(pos + sizeof(Short)); - Byte* dest = &b[pos]; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Short) - 1; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&v); - *dest++ = *src++; - *dest = *src; -#endif -} - - -void -IceInternal::BasicStream::read(Short& v) -{ - if(b.end() - i < static_cast<int>(sizeof(Short))) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - const Byte* src = &(*i); - i += sizeof(Short); -#ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Short) - 1; - *dest-- = *src++; - *dest = *src; -#else - Byte* dest = reinterpret_cast<Byte*>(&v); - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::write(const Short* begin, const Short* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz * sizeof(Short)); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Short) - 1; - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - *dest++ = *src--; - *dest++ = *src--; - src += 2 * sizeof(Short); - } -#else - memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Short)); -#endif - } -} - -void -IceInternal::BasicStream::read(vector<Short>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Short))); - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Short)); - v.resize(sz); -#ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Short) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Short); - } -#else - copy(begin, i, reinterpret_cast<Byte*>(&v[0])); -#endif - } - else - { - v.clear(); - } -} - -Short* -IceInternal::BasicStream::read(pair<const Short*, const Short*>& v) -{ - Short* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Short))); -#if defined(__i386) || defined(_M_IX86) - v.first = reinterpret_cast<Short*>(i); - i += sz * static_cast<int>(sizeof(Short)); - v.second = reinterpret_cast<Short*>(i); -#else - result = new Short[sz]; - v.first = result; - v.second = result + sz; - - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Short)); -# ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Short) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Short); - } -# else - copy(begin, i, reinterpret_cast<Byte*>(&result[0])); -# endif -#endif - } - else - { - v.first = v.second = 0; - } - return result; -} - -void -IceInternal::BasicStream::write(const Int* begin, const Int* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz * sizeof(Int)); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Int) - 1; - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - src += 2 * sizeof(Int); - } -#else - memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Int)); -#endif - } -} - -void -IceInternal::BasicStream::read(vector<Int>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Int))); - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Int)); - v.resize(sz); -#ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Int) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Int); - } -#else - copy(begin, i, reinterpret_cast<Byte*>(&v[0])); -#endif - } - else - { - v.clear(); - } -} - -Int* -IceInternal::BasicStream::read(pair<const Int*, const Int*>& v) -{ - Int* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Int))); -#if defined(__i386) || defined(_M_IX86) - v.first = reinterpret_cast<Int*>(i); - i += sz * static_cast<int>(sizeof(Int)); - v.second = reinterpret_cast<Int*>(i); -#else - result = new Int[sz]; - v.first = result; - v.second = result + sz; - - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Int)); -# ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Int) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Int); - } -# else - copy(begin, i, reinterpret_cast<Byte*>(&result[0])); -# endif -#endif - } - else - { - v.first = v.second = 0; - } - return result; -} - -void -IceInternal::BasicStream::write(Long v) -{ - Container::size_type pos = b.size(); - resize(pos + sizeof(Long)); - Byte* dest = &b[pos]; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Long) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&v); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::read(Long& v) -{ - if(b.end() - i < static_cast<int>(sizeof(Long))) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - const Byte* src = &(*i); - i += sizeof(Long); -#ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Long) - 1; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest = *src; -#else - Byte* dest = reinterpret_cast<Byte*>(&v); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::write(const Long* begin, const Long* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz * sizeof(Long)); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Long) - 1; - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - src += 2 * sizeof(Long); - } -#else - memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Long)); -#endif - } -} - -void -IceInternal::BasicStream::read(vector<Long>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Long))); - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Long)); - v.resize(sz); -#ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Long) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Long); - } -#else - copy(begin, i, reinterpret_cast<Byte*>(&v[0])); -#endif - } - else - { - v.clear(); - } -} - -Long* -IceInternal::BasicStream::read(pair<const Long*, const Long*>& v) -{ - Long* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Long))); -#if defined(__i386) || defined(_M_IX86) - v.first = reinterpret_cast<Long*>(i); - i += sz * static_cast<int>(sizeof(Long)); - v.second = reinterpret_cast<Long*>(i); -#else - result = new Long[sz]; - v.first = result; - v.second = result + sz; - - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Long)); -# ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Long) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Long); - } -# else - copy(begin, i, reinterpret_cast<Byte*>(&result[0])); -# endif -#endif - } - else - { - v.first = v.second = 0; - } - return result; -} - -void -IceInternal::BasicStream::write(Float v) -{ - Container::size_type pos = b.size(); - resize(pos + sizeof(Float)); - Byte* dest = &b[pos]; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Float) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&v); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::read(Float& v) -{ - if(b.end() - i < static_cast<int>(sizeof(Float))) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - const Byte* src = &(*i); - i += sizeof(Float); -#ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Float) - 1; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest = *src; -#else - Byte* dest = reinterpret_cast<Byte*>(&v); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif -} - -void -IceInternal::BasicStream::write(const Float* begin, const Float* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz * sizeof(Float)); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Float) - 1; - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - src += 2 * sizeof(Float); - } -#else - memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Float)); -#endif - } -} - -void -IceInternal::BasicStream::read(vector<Float>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Float))); - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Float)); - v.resize(sz); -#ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Float) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Float); - } -#else - copy(begin, i, reinterpret_cast<Byte*>(&v[0])); -#endif - } - else - { - v.clear(); - } -} - -Float* -IceInternal::BasicStream::read(pair<const Float*, const Float*>& v) -{ - Float* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Float))); -#if defined(__i386) || defined(_M_IX86) - v.first = reinterpret_cast<Float*>(i); - i += sz * static_cast<int>(sizeof(Float)); - v.second = reinterpret_cast<Float*>(i); -#else - result = new Float[sz]; - v.first = result; - v.second = result + sz; - - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Float)); -# ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Float) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Float); - } -# else - copy(begin, i, reinterpret_cast<Byte*>(&result[0])); -# endif -#endif - } - else - { - v.first = v.second = 0; - } - return result; -} - -void -IceInternal::BasicStream::write(Double v) -{ - Container::size_type pos = b.size(); - resize(pos + sizeof(Double)); - Byte* dest = &b[pos]; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&v) + sizeof(Double) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&v); -# if defined(__arm__) && defined(__linux) - dest[4] = *src++; - dest[5] = *src++; - dest[6] = *src++; - dest[7] = *src++; - dest[0] = *src++; - dest[1] = *src++; - dest[2] = *src++; - dest[3] = *src; -# else - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -# endif -#endif -} - -void -IceInternal::BasicStream::read(Double& v) -{ - if(b.end() - i < static_cast<int>(sizeof(Double))) - { - throwUnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - const Byte* src = &(*i); - i += sizeof(Double); -#ifdef ICE_BIG_ENDIAN - Byte* dest = reinterpret_cast<Byte*>(&v) + sizeof(Double) - 1; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest = *src; -#else - Byte* dest = reinterpret_cast<Byte*>(&v); -# if defined(__arm__) && defined(__linux) - dest[4] = *src++; - dest[5] = *src++; - dest[6] = *src++; - dest[7] = *src++; - dest[0] = *src++; - dest[1] = *src++; - dest[2] = *src++; - dest[3] = *src; -# else - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -# endif -#endif -} - -void -IceInternal::BasicStream::write(const Double* begin, const Double* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz * sizeof(Double)); -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(begin) + sizeof(Double) - 1; - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - src += 2 * sizeof(Double); - } -#elif defined(__arm__) && defined(__linux) - const Byte* src = reinterpret_cast<const Byte*>(begin); - Byte* dest = &(*(b.begin() + pos)); - for(int j = 0 ; j < sz ; ++j) - { - dest[4] = *src++; - dest[5] = *src++; - dest[6] = *src++; - dest[7] = *src++; - dest[0] = *src++; - dest[1] = *src++; - dest[2] = *src++; - dest[3] = *src++; - dest += sizeof(Double); - } -#else - memcpy(&b[pos], reinterpret_cast<const Byte*>(begin), sz * sizeof(Double)); -#endif - } -} - -void -IceInternal::BasicStream::read(vector<Double>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Double))); - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Double)); - v.resize(sz); -#ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]) + sizeof(Double) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Double); - } -#elif defined(__arm__) && defined(__linux) - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&v[0]); - for(int j = 0 ; j < sz ; ++j) - { - dest[4] = *src++; - dest[5] = *src++; - dest[6] = *src++; - dest[7] = *src++; - dest[0] = *src++; - dest[1] = *src++; - dest[2] = *src++; - dest[3] = *src++; - dest += sizeof(Double); - } -#else - copy(begin, i, reinterpret_cast<Byte*>(&v[0])); -#endif - } - else - { - v.clear(); - } -} - -Double* -IceInternal::BasicStream::read(pair<const Double*, const Double*>& v) -{ - Double* result = 0; - Int sz; - readSize(sz); - if(sz > 0) - { - checkFixedSeq(sz, static_cast<int>(sizeof(Double))); -#if defined(__i386) || defined(_M_IX86) - v.first = reinterpret_cast<Double*>(i); - i += sz * static_cast<int>(sizeof(Double)); - v.second = reinterpret_cast<Double*>(i); -#else - result = new Double[sz]; - v.first = result; - v.second = result + sz; - - Container::iterator begin = i; - i += sz * static_cast<int>(sizeof(Double)); -# ifdef ICE_BIG_ENDIAN - const Byte* src = &(*begin); - Byte* dest = reinterpret_cast<Byte*>(&result[0]) + sizeof(Double) - 1; - for(int j = 0 ; j < sz ; ++j) - { - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - *dest-- = *src++; - dest += 2 * sizeof(Double); - } -# else - copy(begin, i, reinterpret_cast<Byte*>(&result[0])); -# endif -#endif - } - else - { - v.first = v.second = 0; - } - return result; -} - - - -// -// NOTE: This member function is intentionally omitted in order to -// cause a link error if it is used. This is for efficiency reasons: -// writing a const char * requires a traversal of the string to get -// the string length first, which takes O(n) time, whereas getting the -// string length from a std::string takes constant time. -// -/* -void -IceInternal::BasicStream::write(const char*) -{ -} -*/ - -#ifdef ICEE_HAS_WSTRING - -void -IceInternal::BasicStream::writeConverted(const string& v) -{ - // - // What is the size of the resulting UTF-8 encoded string? - // Impossible to tell, so we guess. If we don't guess correctly, - // we'll have to fix the mistake afterwards - // - - Int guessedSize = static_cast<Int>(v.size()); - writeSize(guessedSize); // writeSize() only writes the size; it does not reserve any buffer space. - - size_t firstIndex = b.size(); - StreamUTF8BufferI buffer(*this); - - Byte* lastByte = _stringConverter->toUTF8(v.data(), v.data() + v.size(), buffer); - if(lastByte != b.end()) - { - b.resize(lastByte - b.begin()); - } - size_t lastIndex = b.size(); - - Int actualSize = static_cast<Int>(lastIndex - firstIndex); - - // - // Check against the guess - // - if(guessedSize != actualSize) - { - if(guessedSize <= 254 && actualSize > 254) - { - // - // Move the UTF-8 sequence 4 bytes further - // Use memmove instead of memcpy since the source and destination typically overlap. - // - resize(b.size() + 4); - memmove(b.begin() + firstIndex + 4, b.begin() + firstIndex, actualSize); - } - else if(guessedSize > 254 && actualSize <= 254) - { - // - // Move the UTF-8 sequence 4 bytes back - // - memmove(b.begin() + firstIndex - 4, b.begin() + firstIndex, actualSize); - resize(b.size() - 4); - } - - if(guessedSize <= 254) - { - rewriteSize(actualSize, b.begin() + firstIndex - 1); - } - else - { - rewriteSize(actualSize, b.begin() + firstIndex - 1 - 4); - } - } -} - -#endif - -void -IceInternal::BasicStream::write(const string* begin, const string* end, bool convert) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - for(int i = 0; i < sz; ++i) - { - write(begin[i], convert); - } - } -} - -void -IceInternal::BasicStream::read(vector<string>& v, bool convert) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - startSeq(sz, 1); - v.resize(sz); - for(int i = 0; i < sz; ++i) - { - read(v[i], convert); - checkSeq(); - endElement(); - } - endSeq(sz); - } - else - { - v.clear(); - } -} - -#ifdef ICEE_HAS_WSTRING - -void -IceInternal::BasicStream::write(const wstring& v) -{ - if(v.size() == 0) - { - writeSize(0); - return; - } - - // - // What is the size of the resulting UTF-8 encoded string? - // Impossible to tell, so we guess. If we don't guess correctly, - // we'll have to fix the mistake afterwards - // - - Int guessedSize = static_cast<Int>(v.size()); - writeSize(guessedSize); // writeSize() only writes the size; it does not reserve any buffer space. - - size_t firstIndex = b.size(); - StreamUTF8BufferI buffer(*this); - - Byte* lastByte = _wstringConverter->toUTF8(v.data(), v.data() + v.size(), buffer); - if(lastByte != b.end()) - { - b.resize(lastByte - b.begin()); - } - size_t lastIndex = b.size(); - - Int actualSize = static_cast<Int>(lastIndex - firstIndex); - - // - // Check against the guess - // - if(guessedSize != actualSize) - { - if(guessedSize <= 254 && actualSize > 254) - { - // - // Move the UTF-8 sequence 4 bytes further - // Use memmove instead of memcpy since the source and destination typically overlap. - // - resize(b.size() + 4); - memmove(b.begin() + firstIndex + 4, b.begin() + firstIndex, actualSize); - } - else if(guessedSize > 254 && actualSize <= 254) - { - // - // Move the UTF-8 sequence 4 bytes back - // - memmove(b.begin() + firstIndex - 4, b.begin() + firstIndex, actualSize); - resize(b.size() - 4); - } - - if(guessedSize <= 254) - { - rewriteSize(actualSize, b.begin() + firstIndex - 1); - } - else - { - rewriteSize(actualSize, b.begin() + firstIndex - 1 - 4); - } - } -} - -void -IceInternal::BasicStream::write(const wstring* begin, const wstring* end) -{ - Int sz = static_cast<Int>(end - begin); - writeSize(sz); - if(sz > 0) - { - for(int i = 0; i < sz; ++i) - { - write(begin[i]); - } - } -} - -void -IceInternal::BasicStream::read(vector<wstring>& v) -{ - Int sz; - readSize(sz); - if(sz > 0) - { - startSeq(sz, 1); - v.resize(sz); - for(int j = 0; j < sz; ++j) - { - read(v[j]); - checkSeq(); - endElement(); - } - endSeq(sz); - } - else - { - v.clear(); - } -} - -#endif - -void -IceInternal::BasicStream::write(const ObjectPrx& v) -{ - _instance->proxyFactory()->proxyToStream(v, this); -} - -void -IceInternal::BasicStream::read(ObjectPrx& v) -{ - v = _instance->proxyFactory()->streamToProxy(this); -} - -void -IceInternal::BasicStream::write(const UserException& v) -{ - write(false); - v.__write(this); -} - -void -IceInternal::BasicStream::throwException() -{ - bool usesClasses; - read(usesClasses); - - string id; - read(id, false); - for(;;) - { - // - // Look for a factory for this ID. - // - UserExceptionFactoryPtr factory = factoryTable->getExceptionFactory(id); - if(factory) - { - // - // Got factory -- get the factory to instantiate the - // exception, initialize the exception members, and throw - // the exception. - // - try - { - factory->createAndThrow(); - } - catch(UserException& ex) - { - ex.__read(this, false); - assert(!usesClasses); - ex.ice_throw(); - } - } - else - { - skipSlice(); // Slice off what we don't understand. - read(id, false); // Read type id for next slice. - } - } - - // - // The only way out of the loop above is to find an exception for - // which the receiver has a factory. If this does not happen, - // sender and receiver disagree about the Slice definitions they - // use. In that case, the receiver will eventually fail to read - // another type ID and throw a MarshalException. - // -} - -IceInternal::BasicStream::SeqData::SeqData(int num, int sz) : numElements(num), minSize(sz) -{ -} diff --git a/cppe/src/IceE/Buffer.cpp b/cppe/src/IceE/Buffer.cpp deleted file mode 100644 index bbe06c08d49..00000000000 --- a/cppe/src/IceE/Buffer.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Buffer.h> -#include <IceE/LocalException.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -void -IceInternal::Buffer::swap(Buffer& other) -{ -#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION - Container::difference_type pos = i - b.begin(); - Container::difference_type otherPos = other.i - other.b.begin(); - b.swap(other.b); - i = b.begin() + otherPos; - other.i = other.b.begin() + pos; -#else - b.swap(other.b); - std::swap(i, other.i); -#endif -} - -void -IceInternal::Buffer::Container::swap(Container& other) -{ -#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION - if(_buf == _fixed) - { - if(other._buf == other._fixed) - { - value_type tmp[ICE_BUFFER_FIXED_SIZE]; - memcpy(tmp, _fixed, _size); - memcpy(_fixed, other._fixed, other._size); - memcpy(other._fixed, tmp, _size); - } - else - { - _buf = other._buf; - memcpy(other._fixed, _fixed, _size); - other._buf = other._fixed; - } - } - else - { - if(other._buf == other._fixed) - { - other._buf = _buf; - memcpy(_fixed, other._fixed, other._size); - _buf = _fixed; - } - else - { - std::swap(_buf, other._buf); - } - } -#else - std::swap(_buf, other._buf); -#endif - - std::swap(_size, other._size); - std::swap(_capacity, other._capacity); - std::swap(_shrinkCounter, other._shrinkCounter); -} - -void -IceInternal::Buffer::Container::clear() -{ -#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION - if(_buf != _fixed) - { - free(_buf); - _buf = _fixed; - } - _size = 0; - _capacity = ICE_BUFFER_FIXED_SIZE; -#else - free(_buf); - _buf = 0; - _size = 0; - _capacity = 0; -#endif -} - -void -IceInternal::Buffer::Container::reserve(size_type n) -{ - if(n > _capacity) - { - _capacity = std::max<size_type>(n, std::min(2 * _capacity, _maxCapacity)); - _capacity = std::max<size_type>(static_cast<size_type>(240), _capacity); - } - else if(n < _capacity) - { - _capacity = n; - } - else - { - return; - } - -#ifdef ICE_SMALL_MESSAGE_BUFFER_OPTIMIZATION - if(_buf != _fixed) - { - _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity)); - } - else if(_capacity > ICE_BUFFER_FIXED_SIZE) - { - _buf = reinterpret_cast<pointer>(malloc(_capacity)); - memcpy(_buf, _fixed, _size); - } -#else - if(_buf) - { - _buf = reinterpret_cast<pointer>(realloc(_buf, _capacity)); - } - else - { - _buf = reinterpret_cast<pointer>(malloc(_capacity)); - } -#endif - - if(!_buf) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } -} diff --git a/cppe/src/IceE/Communicator.cpp b/cppe/src/IceE/Communicator.cpp deleted file mode 100644 index f1000b53675..00000000000 --- a/cppe/src/IceE/Communicator.cpp +++ /dev/null @@ -1,212 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Communicator.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/Router.h> -#endif -#ifdef ICEE_HAS_LOCATOR -# include <IceE/Locator.h> -#endif -#include <IceE/Instance.h> -#include <IceE/Properties.h> -#include <IceE/ReferenceFactory.h> -#include <IceE/ProxyFactory.h> -#include <IceE/LoggerUtil.h> -#include <IceE/LocalException.h> - -#ifndef ICEE_PURE_CLIENT -# include <IceE/ObjectAdapterFactory.h> -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(::Ice::Communicator* p) { return p; } - -void -Ice::Communicator::destroy() -{ - _instance->destroy(); -} - -#ifndef ICEE_PURE_CLIENT - -void -Ice::Communicator::shutdown() -{ - _instance->objectAdapterFactory()->shutdown(); -} - -void -Ice::Communicator::waitForShutdown() -{ - _instance->objectAdapterFactory()->waitForShutdown(); -} - -bool -Ice::Communicator::isShutdown() const -{ - return _instance->objectAdapterFactory()->isShutdown(); -} - -#endif - -ObjectPrx -Ice::Communicator::stringToProxy(const string& s) const -{ - return _instance->proxyFactory()->stringToProxy(s); -} - -string -Ice::Communicator::proxyToString(const ObjectPrx& proxy) const -{ - return _instance->proxyFactory()->proxyToString(proxy); -} - -ObjectPrx -Ice::Communicator::propertyToProxy(const string& p) const -{ - return _instance->proxyFactory()->propertyToProxy(p); -} - -Identity -Ice::Communicator::stringToIdentity(const string& s) const -{ - return _instance->stringToIdentity(s); -} - -string -Ice::Communicator::identityToString(const Identity& ident) const -{ - return _instance->identityToString(ident); -} - -#ifndef ICEE_PURE_CLIENT - -ObjectAdapterPtr -Ice::Communicator::createObjectAdapter(const string& name) -{ - return createObjectAdapterWithEndpoints(name, getProperties()->getProperty(name + ".Endpoints")); -} - -ObjectAdapterPtr -Ice::Communicator::createObjectAdapterWithEndpoints(const string& name, const string& endpoints) -{ - return _instance->objectAdapterFactory()->createObjectAdapter(name, endpoints -#ifdef ICEE_HAS_ROUTER - , 0 -# endif - ); -} - -#ifdef ICEE_HAS_ROUTER - -ObjectAdapterPtr -Ice::Communicator::createObjectAdapterWithRouter(const string& name, const RouterPrx& router) -{ - return _instance->objectAdapterFactory()->createObjectAdapter(name, "", router); -} - -#endif - -#endif - -PropertiesPtr -Ice::Communicator::getProperties() const -{ - return _instance->initializationData().properties; -} - -LoggerPtr -Ice::Communicator::getLogger() const -{ - return _instance->initializationData().logger; -} - -#ifdef ICEE_HAS_ROUTER - -RouterPrx -Ice::Communicator::getDefaultRouter() const -{ - return _instance->referenceFactory()->getDefaultRouter(); -} - -void -Ice::Communicator::setDefaultRouter(const RouterPrx& router) -{ - _instance->referenceFactory()->setDefaultRouter(router); -} - -#endif - -#ifdef ICEE_HAS_LOCATOR - -LocatorPrx -Ice::Communicator::getDefaultLocator() const -{ - return _instance->referenceFactory()->getDefaultLocator(); -} - -void -Ice::Communicator::setDefaultLocator(const LocatorPrx& locator) -{ - _instance->referenceFactory()->setDefaultLocator(locator); -} - -#endif - -#ifdef ICEE_HAS_BATCH - -void -Ice::Communicator::flushBatchRequests() -{ - _instance->flushBatchRequests(); -} - -#endif - -Ice::Communicator::Communicator(const InitializationData& initData) -{ - __setNoDelete(true); - try - { - const_cast<InstancePtr&>(_instance) = new Instance(this, initData); - } - catch(...) - { - __setNoDelete(false); - throw; - } - __setNoDelete(false); -} - -Ice::Communicator::~Communicator() -{ - if(!_instance->destroyed()) - { - Warning out(_instance->initializationData().logger); - out << "Ice::Communicator::destroy() has not been called"; - } -} - -void -Ice::Communicator::finishSetup(int& argc, char* argv[]) -{ - try - { - _instance->finishSetup(argc, argv); - } - catch(...) - { - _instance->destroy(); - throw; - } -} diff --git a/cppe/src/IceE/Cond.cpp b/cppe/src/IceE/Cond.cpp deleted file mode 100644 index 40cb6d53f34..00000000000 --- a/cppe/src/IceE/Cond.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Cond.h> - -#ifndef _WIN32 -# include <sys/time.h> -#endif - -#ifdef _WIN32 - -IceUtil::Semaphore::Semaphore(long initial) -{ - _sem = CreateSemaphore(0, initial, 0x7fffffff, 0); - if(_sem == INVALID_HANDLE_VALUE) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -IceUtil::Semaphore::~Semaphore() -{ - CloseHandle(_sem); -} - -void -IceUtil::Semaphore::wait() const -{ - int rc = WaitForSingleObject(_sem, INFINITE); - if(rc != WAIT_OBJECT_0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -bool -IceUtil::Semaphore::timedWait(const Time& timeout) const -{ - long msec = (long)timeout.toMilliSeconds(); - - int rc = WaitForSingleObject(_sem, msec); - if(rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - return rc != WAIT_TIMEOUT; -} - -void -IceUtil::Semaphore::post(int count) const -{ - int rc = ReleaseSemaphore(_sem, count, 0); - if(rc == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -IceUtil::Cond::Cond() : - _gate(1), - _blocked(0), - _unblocked(0), - _toUnblock(0) -{ -} - -IceUtil::Cond::~Cond() -{ -} - -void -IceUtil::Cond::signal() -{ - wake(false); -} - -void -IceUtil::Cond::broadcast() -{ - wake(true); -} - -void -IceUtil::Cond::wake(bool broadcast) -{ - // - // Lock gate & mutex. - // - _gate.wait(); - _internal.lock(); - - if(_unblocked != 0) - { - _blocked -= _unblocked; - _unblocked = 0; - } - - if(_blocked > 0) - { - // - // Unblock some number of waiters. - // - _toUnblock = (broadcast) ? _blocked : 1; - _internal.unlock(); - _queue.post(); - } - else - { - // - // Otherwise no blocked waiters, release gate & mutex. - // - _gate.post(); - _internal.unlock(); - } -} - -void -IceUtil::Cond::preWait() const -{ - _gate.wait(); - _blocked++; - _gate.post(); -} - -void -IceUtil::Cond::postWait(bool timedOut) const -{ - _internal.lock(); - _unblocked++; - - if(_toUnblock != 0) - { - bool last = --_toUnblock == 0; - _internal.unlock(); - - if(timedOut) - { - _queue.wait(); - } - - if(last) - { - _gate.post(); - } - else - { - _queue.post(); - } - } - else - { - _internal.unlock(); - } -} - -void -IceUtil::Cond::dowait() const -{ - try - { - _queue.wait(); - postWait(false); - } - catch(...) - { - postWait(false); - throw; - } -} - -bool -IceUtil::Cond::timedDowait(const Time& timeout) const -{ - try - { - bool rc = _queue.timedWait(timeout); - postWait(!rc); - return rc; - } - catch(...) - { - postWait(false); - throw; - } -} - -#else - -IceUtil::Cond::Cond() -{ - int rc; - - pthread_condattr_t attr; - - rc = pthread_condattr_init(&attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - - rc = pthread_cond_init(&_cond, &attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - - rc = pthread_condattr_destroy(&attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -} - -IceUtil::Cond::~Cond() -{ - int rc = 0; - rc = pthread_cond_destroy(&_cond); - assert(rc == 0); -} - -void -IceUtil::Cond::signal() -{ - int rc = pthread_cond_signal(&_cond); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -} - -void -IceUtil::Cond::broadcast() -{ - int rc = pthread_cond_broadcast(&_cond); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -} - -#endif diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp deleted file mode 100644 index ede6a022e86..00000000000 --- a/cppe/src/IceE/Connection.cpp +++ /dev/null @@ -1,1916 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/Connection.h> -#include <IceE/Instance.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Properties.h> -#include <IceE/TraceUtil.h> -#include <IceE/DefaultsAndOverrides.h> -#include <IceE/Transceiver.h> -#include <IceE/Endpoint.h> -#include <IceE/Outgoing.h> -#include <IceE/LocalException.h> -#include <IceE/Protocol.h> -#include <IceE/ReferenceFactory.h> // For createProxy(). -#include <IceE/ProxyFactory.h> // For createProxy(). -#include <IceE/BasicStream.h> -#include <IceE/TraceLevels.h> - -#ifndef ICEE_PURE_CLIENT -# include <IceE/Incoming.h> -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Connection* p) { return p; } - -void -Ice::Connection::waitForValidation() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - while(_state == StateNotValidated) - { - wait(); - } - - if(_state >= StateClosing) - { - assert(_exception.get()); - _exception->ice_throw(); - } -} - -void -Ice::Connection::activate() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateActive); -} - -#ifndef ICEE_PURE_CLIENT -void -Ice::Connection::hold() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateHolding); -} -#endif - -void -Ice::Connection::destroy(DestructionReason reason) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - switch(reason) - { -#ifndef ICEE_PURE_CLIENT - case ObjectAdapterDeactivated: - { - setState(StateClosing, ObjectAdapterDeactivatedException(__FILE__, __LINE__)); - break; - } -#endif - - case CommunicatorDestroyed: - { - setState(StateClosing, CommunicatorDestroyedException(__FILE__, __LINE__)); - break; - } - } -} - -void -Ice::Connection::close(bool force) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(force) - { - setState(StateClosed, ForcedCloseConnectionException(__FILE__, __LINE__)); - } - else - { -#ifndef ICEE_PURE_BLOCKING_CLIENT - // - // If we do a graceful shutdown, then we wait until all - // outstanding requests have been completed. Otherwise, the - // CloseConnectionException will cause all outstanding - // requests to be retried, regardless of whether the server - // has processed them or not. - // - while(!_requests.empty()) - { - wait(); - } -#endif - - setState(StateClosing, CloseConnectionException(__FILE__, __LINE__)); - } -} - -bool -Ice::Connection::isDestroyed() const -{ - // - // We can not use trylock here, otherwise the outgoing connection - // factory might return destroyed (closing or closed) connections, - // resulting in connection retry exhaustion. - // - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - return _state >= StateClosing; -} - -bool -Ice::Connection::isFinished() const -{ -#ifndef ICEE_PURE_BLOCKING_CLIENT - IceUtil::ThreadPtr threadPerConnection; -#endif - - { - // - // We can use trylock here, because as long as there are still - // threads operating in this connection object, connection - // destruction is considered as not yet finished. - // - IceUtil::Monitor<IceUtil::Mutex>::TryLock sync(*this); - - if(!sync.acquired()) - { - return false; - } - - if(_transceiver != 0 -#ifndef ICEE_PURE_BLOCKING_CLIENT - || _dispatchCount != 0 || (_threadPerConnection && _threadPerConnection->isAlive()) -#endif - ) - { - return false; - } - - assert(_state == StateClosed); - -#ifndef ICEE_PURE_BLOCKING_CLIENT - threadPerConnection = _threadPerConnection; - _threadPerConnection = 0; -#endif - } - -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(threadPerConnection) - { - threadPerConnection->getThreadControl().join(); - } -#endif - - return true; -} - -void -Ice::Connection::throwException() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_exception.get()) - { - assert(_state >= StateClosing); - _exception->ice_throw(); - } -} - -#ifndef ICEE_PURE_CLIENT - -void -Ice::Connection::waitUntilHolding() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - while(_state < StateHolding || _dispatchCount > 0) - { - wait(); - } -} - -#endif - -void -Ice::Connection::waitUntilFinished() -{ -#ifndef ICEE_PURE_BLOCKING_CLIENT - IceUtil::ThreadPtr threadPerConnection; -#endif - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // We wait indefinitely until connection closing has been - // initiated. We also wait indefinitely until all outstanding - // requests are completed. Otherwise we couldn't guarantee - // that there are no outstanding calls when deactivate() is - // called on the servant locators. - // - while(_state < StateClosing || _dispatchCount > 0) - { - wait(); - } - - // - // Now we must wait until close() has been called on the - // transceiver. - // - while(_transceiver) - { - if(_state != StateClosed && _endpoint->timeout() >= 0) - { - IceUtil::Time timeout = IceUtil::Time::milliSeconds(_endpoint->timeout()); - IceUtil::Time waitTime = _stateTime + timeout - IceUtil::Time::now(); - - if(waitTime > IceUtil::Time()) - { - // - // We must wait a bit longer until we close this - // connection. - // - if(!timedWait(waitTime)) - { - setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__)); - } - } - else - { - // - // We already waited long enough, so let's close this - // connection! - // - setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__)); - } - - // - // No return here, we must still wait until close() is - // called on the _transceiver. - // - } - else - { - wait(); - } - } - - assert(_state == StateClosed); - -#ifndef ICEE_PURE_BLOCKING_CLIENT - threadPerConnection = _threadPerConnection; - _threadPerConnection = 0; -#endif - } - -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(threadPerConnection) - { - threadPerConnection->getThreadControl().join(); - } -#endif -} - -void -Ice::Connection::sendRequest(BasicStream* os, Outgoing* out) -{ - bool requestSent = false; - try - { - Lock sendSync(_sendMonitor); - if(!_transceiver) - { - assert(_exception.get()); - // - // If the connection is closed before we even have a chance - // to send our request, we always try to send the request - // again. - // - throw LocalExceptionWrapper(*_exception.get(), true); - } - - Int requestId; - if(out) - { - // - // Create a new unique request ID. - // - requestId = _nextRequestId++; - if(requestId <= 0) - { - _nextRequestId = 1; - requestId = _nextRequestId++; - } - - // - // Fill in the request ID. - // - Byte* dest = &(os->b[0]) + headerSize; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&requestId) + sizeof(Ice::Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&requestId); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif - -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(!_blocking) - { - _requestsHint = _requests.insert(_requests.end(), pair<const Int, Outgoing*>(requestId, out)); - } -#endif - } - - // - // Fill in the message size. - // - const Int sz = static_cast<Int>(os->b.size()); - Byte* dest = &(os->b[0]) + 10; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&sz); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif - - // - // Send the request. - // - os->i = os->b.begin(); - if(_traceLevels->protocol >= 1) - { - traceRequest("sending request", *os, _logger, _traceLevels); - } - _transceiver->write(*os); - requestSent = true; - - if(!out) - { - return; - } - -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(_blocking) - { -#endif - // - // Re-use the stream for reading the reply. - // - os->reset(); - - Int receivedRequestId = 0; -#ifndef ICEE_PURE_CLIENT - Int invokeNum = 0; - readStreamAndParseMessage(*os, receivedRequestId, invokeNum); - if(invokeNum > 0) - { - throwUnknownMessageException(__FILE__, __LINE__); - } - else if(requestId != receivedRequestId) - { - throwUnknownRequestIdException(__FILE__, __LINE__); - } -#else - readStreamAndParseMessage(*os, receivedRequestId); - if(requestId != receivedRequestId) - { - throwUnknownRequestIdException(__FILE__, __LINE__); - } -#endif - out->finished(*os); -#ifndef ICEE_PURE_BLOCKING_CLIENT - } - else - { - // - // Wait until the request has completed, or until the request times out. - // - Int tout = timeout(); - IceUtil::Time expireTime; - if(tout > 0) - { - expireTime = IceUtil::Time::now() + IceUtil::Time::milliSeconds(tout); - } - - while(out->state() == Outgoing::StateInProgress) - { - if(tout > 0) - { - IceUtil::Time now = IceUtil::Time::now(); - if(now < expireTime) - { - _sendMonitor.timedWait(expireTime - now); - } - - // - // Make sure we woke up because of timeout and not another response. - // - if(out->state() == Outgoing::StateInProgress && IceUtil::Time::now() > expireTime) - { - throw TimeoutException(__FILE__, __LINE__); - } - } - else - { - _sendMonitor.wait(); - } - } - } -#endif - } - catch(const LocalException& ex) - { - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - assert(_exception.get()); - if(!requestSent) - { - _exception->ice_throw(); - } - } - - // - // If the request was already sent, we don't throw directly - // but instead we set the Outgoing object exception with - // finished(). Throwing directly would break "at-most-once" - // (see also comment in Outgoing.invoke()) - // - IceUtil::Monitor<IceUtil::Mutex>::Lock sendSync(_sendMonitor); -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(_blocking) - { -#endif - out->finished(ex); -#ifndef ICEE_PURE_BLOCKING_CLIENT - } - else - { - while(out->state() == Outgoing::StateInProgress) - { - _sendMonitor.wait(); // Wait for the thread to propagate the exception to the Outgoing object. - } - } -#endif - } -} - -#ifdef ICEE_HAS_BATCH - -void -Ice::Connection::prepareBatchRequest(BasicStream* os) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Wait if flushing is currently in progress. - // - while(_batchStreamInUse && !_exception.get()) - { - wait(); - } - - if(_exception.get()) - { - _exception->ice_throw(); - } - - assert(_state > StateNotValidated); - assert(_state < StateClosing); - - if(_batchStream.b.empty()) - { - try - { - _batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr)); - } - catch(const LocalException& ex) - { - setState(StateClosed, ex); - ex.ice_throw(); - } - } - - _batchStreamInUse = true; - _batchMarker = _batchStream.b.size(); - _batchStream.swap(*os); - - // - // The batch stream now belongs to the caller, until - // finishBatchRequest() or abortBatchRequest() is called. - // -} - -void -Ice::Connection::finishBatchRequest(BasicStream* os) -{ - bool autoflush = false; - vector<Ice::Byte> lastRequest; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Get the batch stream back. - // - _batchStream.swap(*os); - - if(_batchAutoFlush) - { - Lock sendSync(_sendMonitor); - - if(!_transceiver) - { - assert(_exception.get()); - _exception->ice_throw(); // The exception is immutable at this point. - } - - // - // Throw memory limit exception if the first message added causes us to - // go over limit. Otherwise put aside the marshalled message that caused - // limit to be exceeded and rollback stream to the marker. - // - if(_batchStream.b.size() > _instance->messageSizeMax()) - { - if(_batchRequestNum == 0) - { - resetBatch(true); - throwMemoryLimitException(__FILE__, __LINE__); - } - vector<Ice::Byte>(_batchStream.b.begin() + _batchMarker, _batchStream.b.end()).swap(lastRequest); - _batchStream.b.resize(_batchMarker); - autoflush = true; - } - } - - if(!autoflush) - { - // - // Increment the number of requests in the batch. - // - ++_batchRequestNum; - - // - // Notify about the batch stream not being in use anymore. - // - assert(_batchStreamInUse); - _batchStreamInUse = false; - notifyAll(); - } - } - - if(autoflush) - { - // - // We have to keep _batchStreamInUse set until after we insert the - // saved marshalled data into a new stream. - // - flushBatchRequestsInternal(true); - - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Throw memory limit exception if the message that caused us to go over - // limit causes us to exceed the limit by itself. - // - if(sizeof(requestBatchHdr) + lastRequest.size() > _instance->messageSizeMax()) - { - resetBatch(true); - throwMemoryLimitException(__FILE__, __LINE__); - } - - // - // Start a new batch with the last message that caused us to - // go over the limit. - // - try - { - _batchStream.writeBlob(requestBatchHdr, sizeof(requestBatchHdr)); - _batchStream.writeBlob(&lastRequest[0], lastRequest.size()); - } - catch(const LocalException& ex) - { - setState(StateClosed, ex); - ex.ice_throw(); - } - - // - // Notify that the batch stream not in use anymore. - // - ++_batchRequestNum; - _batchStreamInUse = false; - notifyAll(); - } -} - -void -Ice::Connection::abortBatchRequest() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Reset the batch stream. We cannot save old requests - // in the batch stream, as they might be corrupted due to - // incomplete marshaling. - // - resetBatch(true); -} - -void -Ice::Connection::flushBatchRequests() -{ - flushBatchRequestsInternal(false); -} - -void -Ice::Connection::flushBatchRequestsInternal(bool ignoreInUse) -{ - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(!ignoreInUse) - { - while(_batchStreamInUse && !_exception.get()) - { - wait(); - } - } - - if(_exception.get()) - { - _exception->ice_throw(); - } - - if(_batchStream.b.empty()) - { - return; // Nothing to do. - } - - assert(_state > StateNotValidated); - assert(_state < StateClosing); - - _batchStream.i = _batchStream.b.begin(); - - // - // Prevent that new batch requests are added while we are - // flushing. - // - _batchStreamInUse = true; - } - - try - { - Lock sendSync(_sendMonitor); - - if(!_transceiver) // Has the transceiver already been closed? - { - assert(_exception.get()); - _exception->ice_throw(); // The exception is immutable at this point. - } - - // - // Fill in the number of requests in the batch. - // - Byte* dest = &(_batchStream.b[0]) + headerSize; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum) + sizeof(Ice::Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&_batchRequestNum); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif - - const Int sz = static_cast<Int>(_batchStream.b.size()); - dest = &(_batchStream.b[0]) + 10; -#ifdef ICE_BIG_ENDIAN - src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - src = reinterpret_cast<const Byte*>(&sz); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif - - // - // Send the batch request. - // - _batchStream.i = _batchStream.b.begin(); - if(_traceLevels->protocol >= 1) - { - traceBatchRequest("sending batch request", _batchStream, _logger, _traceLevels); - } - _transceiver->write(_batchStream); - } - catch(const LocalException& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - assert(_exception.get()); - - // - // Since batch requests are all oneways, we - // must report the exception to the caller. - // - _exception->ice_throw(); - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Reset the batch stream, and notify that flushing is over. - // - resetBatch(!ignoreInUse); - } -} - -void -Ice::Connection::resetBatch(bool resetInUse) -{ - BasicStream dummy(_instance.get(), _instance->messageSizeMax(), -#ifdef ICEE_HAS_WSTRING - _instance->initializationData().stringConverter, _instance->initializationData().wstringConverter, -#endif - _batchAutoFlush); - _batchStream.swap(dummy); - _batchRequestNum = 0; - _batchMarker = 0; - - // - // Notify about the batch stream not being in use - // anymore. - // - if(resetInUse) - { - assert(_batchStreamInUse); - _batchStreamInUse = false; - notifyAll(); - } -} - -#endif - -#ifndef ICEE_PURE_CLIENT - -void -Ice::Connection::sendResponse(BasicStream* os) -{ - try - { - Lock sendSync(_sendMonitor); - - if(!_transceiver) // Has the transceiver already been closed? - { - assert(_exception.get()); - _exception->ice_throw(); // The exception is immutable at this point. - } - - - const Int sz = static_cast<Int>(os->b.size()); - Byte* dest = &(os->b[0]) + 10; -#ifdef ICE_BIG_ENDIAN - const Byte* src = reinterpret_cast<const Byte*>(&sz) + sizeof(Ice::Int) - 1; - *dest++ = *src--; - *dest++ = *src--; - *dest++ = *src--; - *dest = *src; -#else - const Byte* src = reinterpret_cast<const Byte*>(&sz); - *dest++ = *src++; - *dest++ = *src++; - *dest++ = *src++; - *dest = *src; -#endif - - // - // Send the reply. - // - os->i = os->b.begin(); - if(_traceLevels->protocol >= 1) - { - traceReply("sending reply", *os, _logger, _traceLevels); - } - _transceiver->write(*os); - } - catch(const LocalException& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_state > StateNotValidated); - - try - { - assert(_dispatchCount > 0); - if(--_dispatchCount == 0) - { - notifyAll(); - } - - if(_state == StateClosing && _dispatchCount == 0) - { - initiateShutdown(); - } - } - catch(const LocalException& ex) - { - setState(StateClosed, ex); - } - } -} - -void -Ice::Connection::sendNoResponse() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_state > StateNotValidated); - - try - { - assert(_dispatchCount > 0); - if(--_dispatchCount == 0) - { - notifyAll(); - } - - if(_state == StateClosing && _dispatchCount == 0) - { - initiateShutdown(); - } - } - catch(const LocalException& ex) - { - setState(StateClosed, ex); - } -} - -#endif - -EndpointPtr -Ice::Connection::endpoint() const -{ - return _endpoint; // No mutex protection necessary, _endpoint is immutable. -} - -#ifndef ICEE_PURE_CLIENT - -void -Ice::Connection::setAdapter(const ObjectAdapterPtr& adapter) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_blocking) - { - throw FeatureNotSupportedException(__FILE__, __LINE__, "setAdapter with blocking connection"); - } - - // - // Wait for all the incoming to be dispatched. We can't modify the - // _adapter and _servantManager if there's incoming because the - // Incoming object is using plain pointers for these objects. - // - while(_dispatchCount > 0) - { - wait(); - } - - if(_exception.get()) - { - _exception->ice_throw(); - } - - assert(_state < StateClosing); - - _in.setAdapter(adapter); -} - -ObjectAdapterPtr -Ice::Connection::getAdapter() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - return _in.getAdapter(); -} - -ObjectPrx -Ice::Connection::createProxy(const Identity& ident) const -{ - // - // Create a reference and return a reverse proxy for this - // reference. - // - vector<ConnectionPtr> connections; - connections.push_back(const_cast<Connection*>(this)); - ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), "", ReferenceModeTwoway, - connections); - return _instance->proxyFactory()->referenceToProxy(ref); -} - -#endif - -string -Ice::Connection::type() const -{ - return _type; // No mutex lock, _type is immutable. -} - -Ice::Int -Ice::Connection::timeout() const -{ - return _endpoint->timeout(); // No mutex lock, _endpoint is immutable. -} - -string -Ice::Connection::toString() const -{ - return _desc; // No mutex lock, _desc is immutable. -} - -#ifndef ICEE_PURE_CLIENT -Ice::Connection::Connection(const InstancePtr& instance, - const TransceiverPtr& transceiver, - const EndpointPtr& endpoint, - const ObjectAdapterPtr& adapter) : -#else - Ice::Connection::Connection(const InstancePtr& instance, - const TransceiverPtr& transceiver, - const EndpointPtr& endpoint) : -#endif - - _instance(instance), - _transceiver(transceiver), - _desc(transceiver->toString()), - _type(transceiver->type()), - _endpoint(endpoint), - _logger(_instance->initializationData().logger), // Cached for better performance. - _traceLevels(_instance->traceLevels()), // Cached for better performance. - _warn(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Connections") > 0), -#ifndef ICEE_PURE_CLIENT - _in(_instance.get(), this, _stream, adapter), -#endif -#ifndef ICEE_PURE_BLOCKING_CLIENT - _stream(_instance.get(), _instance->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , _instance->initializationData().stringConverter, _instance->initializationData().wstringConverter -#endif - ), -#endif -#ifdef ICEE_HAS_BATCH - _batchAutoFlush( - _instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0), - _batchStream(_instance.get(), _instance->messageSizeMax(), -#ifdef ICEE_HAS_WSTRING - _instance->initializationData().stringConverter, _instance->initializationData().wstringConverter, -#endif - _batchAutoFlush), - _batchStreamInUse(false), - _batchRequestNum(0), - _batchMarker(0), -#endif - _dispatchCount(0), - _state(StateNotValidated), - _stateTime(IceUtil::Time::now()), - _nextRequestId(1) -#ifndef ICEE_PURE_BLOCKING_CLIENT - , _requestsHint(_requests.end()) -#endif -{ -#ifndef ICEE_PURE_BLOCKING_CLIENT -# ifdef ICEE_PURE_CLIENT - _blocking = _instance->initializationData().properties->getPropertyAsInt("Ice.Blocking") > 0; -# else - _blocking = _instance->initializationData().properties->getPropertyAsInt("Ice.Blocking") > 0 && !adapter; -# endif - if(_blocking) - { - _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout()); - } - else - { -#ifdef _WIN32 - // - // On Windows, the recv() call doesn't return if the socket is - // shutdown. We use the timeout to not block indefinitely. - // - _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout()); -#else - _transceiver->setTimeouts(-1, _endpoint->timeout()); -#endif - } -#else - _transceiver->setTimeouts(_endpoint->timeout(), _endpoint->timeout()); -#endif - -#ifdef ICEE_PURE_BLOCKING_CLIENT - validate(); -#else - if(_blocking) - { - validate(); - } - else - { - __setNoDelete(true); - try - { - // - // If we are in thread per connection mode, create the thread - // for this connection. - // - _threadPerConnection = new ThreadPerConnection(this); - _threadPerConnection->start(_instance->threadPerConnectionStackSize()); - } - catch(const Ice::Exception& ex) - { - { - Error out(_logger); - out << "cannot create thread for connection:\n" << ex.toString(); - } - - try - { - _transceiver->close(); - } - catch(const LocalException&) - { - // Here we ignore any exceptions in close(). - } - - __setNoDelete(false); - ex.ice_throw(); - } - __setNoDelete(false); - } -#endif -} - -Ice::Connection::~Connection() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_state == StateClosed); - assert(!_transceiver); - assert(_dispatchCount == 0); -#ifndef ICEE_PURE_BLOCKING_CLIENT - assert(!_threadPerConnection); -#endif -} - -void -Ice::Connection::validate() -{ -#ifndef ICEE_PURE_CLIENT - bool active; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // The connection might already be closed (e.g.: the communicator - // was destroyed or object adapter deactivated.) - // - assert(_state == StateNotValidated || _state == StateClosed); - if(_state == StateClosed) - { - assert(_exception.get()); - _exception->ice_throw(); - } - - if(_in.getAdapter()) - { - active = true; // The server side has the active role for connection validation. - } - else - { - active = false; // The client side has the passive role for connection validation. - } - } -#endif - - try - { - Int timeout; - if(_instance->defaultsAndOverrides()->overrideConnectTimeout) - { - timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue; - } - else - { - timeout = _endpoint->timeout(); - } - -#ifndef ICEE_PURE_CLIENT - if(active) - { - BasicStream os(_instance.get(), _instance->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter -#endif - ); - os.write(magic[0]); - os.write(magic[1]); - os.write(magic[2]); - os.write(magic[3]); - os.write(protocolMajor); - os.write(protocolMinor); - os.write(encodingMajor); - os.write(encodingMinor); - os.write(validateConnectionMsg); - os.write(static_cast<Byte>(0)); // Compression status (always zero for validate connection). - os.write(headerSize); // Message size. - os.i = os.b.begin(); - if(_traceLevels->protocol >= 1) - { - traceHeader("sending validate connection", os, _logger, _traceLevels); - } - try - { - _transceiver->writeWithTimeout(os, timeout); - } - catch(const TimeoutException&) - { - throw ConnectTimeoutException(__FILE__, __LINE__); - } - } - else -#endif - { - BasicStream is(_instance.get(), _instance->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter -#endif - ); - is.b.resize(headerSize); - is.i = is.b.begin(); - try - { - _transceiver->readWithTimeout(is, timeout); - } - catch(const TimeoutException&) - { - throw ConnectTimeoutException(__FILE__, __LINE__); - } - assert(is.i == is.b.end()); - is.i = is.b.begin(); - Ice::Byte m[4]; - is.read(m[0]); - is.read(m[1]); - is.read(m[2]); - is.read(m[3]); - if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3]) - { - throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&m[0], &m[0] + sizeof(m))); - } - Byte pMajor; - Byte pMinor; - is.read(pMajor); - is.read(pMinor); - if(pMajor != protocolMajor) - { - throwUnsupportedProtocolException(__FILE__, __LINE__, pMajor, pMinor, protocolMajor, protocolMinor); - } - Byte eMajor; - Byte eMinor; - is.read(eMajor); - is.read(eMinor); - if(eMajor != encodingMajor) - { - throwUnsupportedEncodingException(__FILE__, __LINE__, eMajor, eMinor, encodingMajor, encodingMinor); - } - Byte messageType; - is.read(messageType); - if(messageType != validateConnectionMsg) - { - throwConnectionNotValidatedException(__FILE__, __LINE__); - } - Byte compress; - is.read(compress); // Ignore compression status for validate connection. - Int size; - is.read(size); - if(size != headerSize) - { - throwIllegalMessageSizeException(__FILE__, __LINE__); - } - if(_traceLevels->protocol >= 1) - { - traceHeader("received validate connection", is, _logger, _traceLevels); - } - } - } - catch(const LocalException& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - assert(_exception.get()); - _exception->ice_throw(); - } - -#ifdef ICEE_PURE_CLIENT - activate(); -#else - hold(); -#endif -} - -void -Ice::Connection::setState(State state, const LocalException& ex) -{ - // - // If setState() is called with an exception, then only closed and - // closing states are permissible. - // - assert(state == StateClosing || state == StateClosed); - - if(_state == state) // Don't switch twice. - { - return; - } - - if(!_exception.get()) - { - // - // If we are in closed state, an exception must be set. - // - assert(_state != StateClosed); - - _exception.reset(dynamic_cast<LocalException*>(ex.ice_clone())); - - if(_warn) - { - // - // We don't warn if we are not validated. - // - if(_state > StateNotValidated) - { - // - // Don't warn about certain expected exceptions. - // - if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) || - dynamic_cast<const ForcedCloseConnectionException*>(_exception.get()) || - dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) || -#ifndef ICEE_PURE_CLIENT - dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) || -#endif - (dynamic_cast<const ConnectionLostException*>(_exception.get()) && _state == StateClosing))) - { - Warning out(_logger); - out << "connection exception:\n" << (*_exception.get()).toString() << "\n" << _desc; - } - } - } - } - - // - // We must set the new state before we notify requests of any - // exceptions. Otherwise new requests may retry on a connection - // that is not yet marked as closed or closing. - // - setState(state); -} - -void -Ice::Connection::setState(State state) -{ - if(_state == state) // Don't switch twice. - { - return; - } - - switch(state) - { - case StateNotValidated: - { - assert(false); - break; - } - - case StateActive: - { - // - // Can only switch from holding or not validated to - // active. - // -#ifdef ICEE_PURE_CLIENT - if(_state != StateNotValidated) - { - return; - } -#else - if(_state != StateHolding && _state != StateNotValidated) - { - return; - } -#endif - break; - } - -#ifndef ICEE_PURE_CLIENT - case StateHolding: - { - // - // Can only switch from active or not validated to - // holding. - // - if(_state != StateActive && _state != StateNotValidated) - { - return; - } - break; - } -#endif - - case StateClosing: - { - // - // Can't change back from closed. - // - if(_state == StateClosed) - { - return; - } - break; - } - - case StateClosed: - { - // - // We shutdown both for reading and writing. This will - // unblock and read call with an exception. The thread - // per connection then closes the transceiver. - // - _transceiver->shutdownReadWrite(); - - // - // In blocking mode, we close the transceiver now. - // -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(_blocking) -#endif - { - Lock sync(_sendMonitor); - try - { - _transceiver->close(); - } - catch(const Ice::LocalException&) - { - } - _transceiver = 0; - } - break; - } - } - - _state = state; - _stateTime = IceUtil::Time::now(); - - notifyAll(); - - if(_state == StateClosing && _dispatchCount == 0) - { - try - { - initiateShutdown(); - -#ifndef ICEE_PURE_BLOCKING_CLIENT - if(_blocking) -#endif - { - setState(StateClosed); - } - } - catch(const LocalException& ex) - { - setState(StateClosed, ex); - } - } -} - -void -Ice::Connection::initiateShutdown() const -{ - assert(_state == StateClosing); - assert(_dispatchCount == 0); - - Lock sendSync(_sendMonitor); - - // - // Before we shut down, we send a close connection message. - // - BasicStream os(_instance.get(), _instance->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , _instance->initializationData().stringConverter, _instance->initializationData().wstringConverter -#endif - ); - - os.write(magic[0]); - os.write(magic[1]); - os.write(magic[2]); - os.write(magic[3]); - os.write(protocolMajor); - os.write(protocolMinor); - os.write(encodingMajor); - os.write(encodingMinor); - os.write(closeConnectionMsg); - os.write((Byte)0); // Compression status: compression not supported. - os.write(headerSize); // Message size. - - // - // Send the message. - // - os.i = os.b.begin(); - if(_traceLevels->protocol >= 1) - { - traceHeader("sending close connection", os, _logger, _traceLevels); - } - _transceiver->write(os); - - // - // The CloseConnection message should be sufficient. Closing the - // write end of the socket is probably an artifact of how things - // were done in IIOP. In fact, shutting down the write end of the - // socket causes problems on Windows by preventing the peer from - // using the socket. For example, the peer is no longer able to - // continue writing a large message after the socket is shutdown. - // - //_transceiver->shutdownWrite(); -} - -void -#ifndef ICEE_PURE_CLIENT -Ice::Connection::readStreamAndParseMessage(IceInternal::BasicStream& stream, Int& requestId, Int& invokeNum) -#else -Ice::Connection::readStreamAndParseMessage(IceInternal::BasicStream& stream, Int& requestId) -#endif -{ - // - // Read the header. - // - stream.b.resize(headerSize); - stream.i = stream.b.begin(); - _transceiver->read(stream); - - ptrdiff_t pos = stream.i - stream.b.begin(); - assert(pos >= headerSize); - stream.i = stream.b.begin(); - const Ice::Byte* header; - stream.readBlob(header, headerSize); - if(header[0] != magic[0] || header[1] != magic[1] || header[2] != magic[2] || header[3] != magic[3]) - { - throwBadMagicException(__FILE__, __LINE__, Ice::ByteSeq(&header[0], &header[0] + sizeof(magic))); - } - if(header[4] != protocolMajor) - { - throwUnsupportedProtocolException(__FILE__, __LINE__, header[4], header[5], protocolMajor, protocolMinor); - } - if(header[6] != encodingMajor) - { - throwUnsupportedEncodingException(__FILE__, __LINE__, header[6], header[7], encodingMajor, encodingMinor); - } - const Byte messageType = header[8]; - if(header[9] == 2) - { - throw FeatureNotSupportedException(__FILE__, __LINE__, "compression"); - } - - Int size; - stream.i -= sizeof(Int); - stream.read(size); - if(size < headerSize) - { - throwIllegalMessageSizeException(__FILE__, __LINE__); - } - if(size > static_cast<Int>(_instance->messageSizeMax())) - { - throwMemoryLimitException(__FILE__, __LINE__); - } - if(size > static_cast<Int>(stream.b.size())) - { - stream.b.resize(size); - } - stream.i = stream.b.begin() + pos; - - if(stream.i != stream.b.end()) - { - _transceiver->read(stream); - } - - assert(stream.i == stream.b.end()); - stream.i = stream.b.begin() + headerSize; - - switch(messageType) - { - case closeConnectionMsg: - { - if(_traceLevels->protocol >= 1) - { - traceHeader("received close connection", stream, _logger, _traceLevels); - } - throw CloseConnectionException(__FILE__, __LINE__); - break; - } - - case replyMsg: - { - if(_traceLevels->protocol >= 1) - { - traceReply("received reply", stream, _logger, _traceLevels); - } - stream.read(requestId); - break; - } - -#ifndef ICEE_PURE_CLIENT - case requestMsg: - { - if(_traceLevels->protocol >= 1) - { - traceRequest("received request", stream, _logger, _traceLevels); - } - stream.read(requestId); - invokeNum = 1; - break; - } - - case requestBatchMsg: - { - if(_traceLevels->protocol >= 1) - { - traceBatchRequest("received batch request", stream, _logger, _traceLevels); - } - stream.read(invokeNum); - if(invokeNum < 0) - { - invokeNum = 0; - throwNegativeSizeException(__FILE__, __LINE__); - } - break; - } -#endif - - case validateConnectionMsg: - { - if(_traceLevels->protocol >= 1) - { - traceHeader("received validate connection", stream, _logger, _traceLevels); - } - if(_warn) - { - Warning out(_logger); - out << "ignoring unexpected validate connection message:\n" << _desc; - } - break; - } - - default: - { - if(_traceLevels->protocol >= 1) - { - traceHeader("received unknown message\n(invalid, closing connection)", stream, _logger, _traceLevels); - } - throwUnknownMessageException(__FILE__, __LINE__); - break; - } - } -} - -#ifndef ICEE_PURE_BLOCKING_CLIENT - -void -Ice::Connection::run() -{ - // - // The thread-per-connection must validate and activate this connection, - // and not in the connection factory. Please see the comments in the connection - // factory for details. - // - try - { - validate(); - } - catch(const LocalException&) - { - Lock sync(*this); - assert(_state == StateClosed); - - Lock sendSync(_sendMonitor); - try - { - _transceiver->close(); - } - catch(const LocalException&) - { - // Here we ignore any exceptions in close(). - } - - _transceiver = 0; - notifyAll(); - return; - } - - activate(); - - bool closed = false; - - while(!closed) - { - Int requestId = 0; -#ifndef ICEE_PURE_CLIENT - Int invokeNum = 0; - _in.os()->reset(); -#endif - _stream.reset(); - - // - // Read and parse the next message. We don't need to lock the - // send monitor here as we have the guarantee that - // _transceiver won't be set to 0 by another thread, the - // thread per connection is the only thread that can set - // _transceiver to 0. - // - try - { -#ifndef ICEE_PURE_CLIENT - readStreamAndParseMessage(_stream, requestId, invokeNum); -#else - readStreamAndParseMessage(_stream, requestId); -#endif - } -#ifdef _WIN32 - catch(const Ice::TimeoutException&) - { - // - // See the comment in the Connection constructor. This is - // necessary to not block in recv() indefinitely. - // - continue; - } -#endif - catch(const Ice::LocalException& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - if(_state != StateClosed) - { -#ifndef ICEE_PURE_CLIENT - if(invokeNum > 0) // We received a request or a batch request - { - if(_state == StateClosing) - { - if(_traceLevels->protocol >= 1) - { - string req = invokeNum > 1 ? "received batch request" : "received request"; - req += " during closing\n(ignored by server, client will retry)"; - traceRequest( req.c_str(), _stream, _logger, _traceLevels); - } - invokeNum = 0; - } - _dispatchCount += invokeNum; - } - else -#endif - if(requestId > 0) - { - // - // The message is a reply, we search the Outgoing object waiting - // for this reply and pass it the stream before to notify the - // send monitor to wake up threads waiting for replies. - // - try - { - Lock sync(_sendMonitor); - - map<Int, Outgoing*>::iterator p = _requests.end(); - if(p != _requestsHint) - { - if(_requestsHint->first == requestId) - { - p = _requestsHint; - } - } - - if(p == _requests.end()) - { - p = _requests.find(requestId); - } - - if(p == _requests.end()) - { - throwUnknownRequestIdException(__FILE__, __LINE__); - } - - p->second->finished(_stream); - - if(p == _requestsHint) - { - _requests.erase(p++); - _requestsHint = p; - } - else - { - _requests.erase(p); - } - _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest() - } - catch(const Ice::LocalException& ex) - { - setState(StateClosed, ex); - } - } - } - -#ifndef ICEE_PURE_CLIENT - while(_state == StateHolding) - { - wait(); - } -#endif - - if(_state == StateClosed) - { - Lock sync(_sendMonitor); - try - { - _transceiver->close(); - } - catch(const LocalException&) - { - } - _transceiver = 0; - notifyAll(); - - // - // We cannot simply return here. We have to make sure - // that all requests are notified about the closed - // connection below. - // - closed = true; - } - - if(_state == StateClosed || _state == StateClosing) - { - Lock sync(_sendMonitor); - assert(_exception.get()); - for(map<Int, Outgoing*>::iterator p = _requests.begin(); p != _requests.end(); ++p) - { - p->second->finished(*_exception.get()); // The exception is immutable at this point. - } - _requests.clear(); - _sendMonitor.notifyAll(); // Wake up threads waiting in sendRequest() - } - } - - // - // Method invocation (or multiple invocations for batch - // messages) must be done outside the thread synchronization, - // so that nested calls are possible. - // -#ifndef ICEE_PURE_CLIENT - try - { - for(;invokeNum > 0; --invokeNum) - { - // - // Prepare the response if necessary. - // - const bool response = requestId != 0; - if(response) - { - assert(invokeNum == 1); // No further invocations if a response is expected. - - // - // Add the reply header and request id. - // - BasicStream* os = _in.os(); - os->writeBlob(replyHdr, sizeof(replyHdr)); - os->write(requestId); - } - - // - // Dispatch the incoming request. - // - _in.invoke(response, requestId); - } - } - catch(const LocalException& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed, ex); - } - catch(const std::exception& ex) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - UnknownException uex(__FILE__, __LINE__); - uex.unknown = string("std::exception: ") + ex.what(); - setState(StateClosed, uex); - } - catch(...) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - UnknownException uex(__FILE__, __LINE__); - uex.unknown = "unknown c++ exception"; - setState(StateClosed, uex); - } - - // - // If invoke() above raised an exception, and therefore neither - // sendResponse() nor sendNoResponse() has been called, then we - // must decrement _dispatchCount here. - // - if(invokeNum > 0) - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - assert(_dispatchCount > 0); - _dispatchCount -= invokeNum; - assert(_dispatchCount >= 0); - if(_dispatchCount == 0) - { - notifyAll(); - } - } -#endif - } -} - -Ice::Connection::ThreadPerConnection::ThreadPerConnection(const ConnectionPtr& connection) : - _connection(connection) -{ -} - -void -Ice::Connection::ThreadPerConnection::run() -{ - try - { - _connection->run(); - } - catch(const Exception& ex) - { - Error out(_connection->_logger); - out << "exception in thread per connection:\n" << _connection->toString() << ex.toString(); - } - catch(const std::exception& ex) - { - Error out(_connection->_logger); - out << "std::exception in thread per connection:\n" << _connection->toString() << ex.what(); - } - catch(...) - { - Error out(_connection->_logger); - out << "unknown exception in thread per connection:\n" << _connection->toString(); - } - - _connection = 0; // Resolve cyclic dependency. -} - -#endif // ICEE_PURE_BLOCKING_CLIENT diff --git a/cppe/src/IceE/Connector.h b/cppe/src/IceE/Connector.h deleted file mode 100644 index ad14f217aa2..00000000000 --- a/cppe/src/IceE/Connector.h +++ /dev/null @@ -1,52 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_CONNECTOR_H -#define ICEE_CONNECTOR_H - -#include <IceE/ConnectorF.h> -#include <IceE/TransceiverF.h> -#include <IceE/InstanceF.h> -#include <IceE/TraceLevelsF.h> -#include <IceE/LoggerF.h> -#include <IceE/Shared.h> - -#ifdef _WIN32 -# include <winsock2.h> -#else -# include <netinet/in.h> // For struct sockaddr_in -#endif - -namespace IceInternal -{ - -class Endpoint; - -class Connector : public ::IceUtil::Shared -{ -public: - - TransceiverPtr connect(int); - std::string toString() const; - -private: - - Connector(const InstancePtr&, const std::string&, int); - virtual ~Connector(); - friend class TcpEndpoint; - - InstancePtr _instance; - TraceLevelsPtr _traceLevels; - ::Ice::LoggerPtr _logger; - struct sockaddr_in _addr; -}; - -} - -#endif diff --git a/cppe/src/IceE/ConnectorF.h b/cppe/src/IceE/ConnectorF.h deleted file mode 100644 index a4a119f2aa7..00000000000 --- a/cppe/src/IceE/ConnectorF.h +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_CONNECTOR_F_H -#define ICEE_CONNECTOR_F_H - -#include <IceE/Handle.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class Connector; -IceUtil::Shared* upCast(Connector*); -typedef Handle<Connector> ConnectorPtr; - -} - -#endif diff --git a/cppe/src/IceE/ConvertUTF.cpp b/cppe/src/IceE/ConvertUTF.cpp deleted file mode 100644 index 5b7ddc0070f..00000000000 --- a/cppe/src/IceE/ConvertUTF.cpp +++ /dev/null @@ -1,469 +0,0 @@ -#include <IceE/Config.h> - -#if defined(ICEE_HAS_WSTRING) - -/* - * Copyright 2001-2004 Unicode, Inc. - * - * Disclaimer - * - * This source code is provided as is by Unicode, Inc. No claims are - * made as to fitness for any particular purpose. No warranties of any - * kind are expressed or implied. The recipient agrees to determine - * applicability of information provided. If this file has been - * purchased on magnetic or optical media from Unicode, Inc., the - * sole remedy for any claim will be exchange of defective media - * within 90 days of receipt. - * - * Limitations on Rights to Redistribute This Code - * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form - * for internal or external distribution as long as this notice - * remains attached. - */ - -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - - -/* --------------------------------------------------------------------- - - Conversions between UTF32, UTF-16, and UTF-8. Source code file. - Author: Mark E. Davis, 1994. - Rev History: Rick McGowan, fixes & updates May 2001. - Sept 2001: fixed const & error conditions per - mods suggested by S. Parent & A. Lillich. - June 2002: Tim Dodd added detection and handling of incomplete - source sequences, enhanced error detection, added casts - to eliminate compiler warnings. - July 2003: slight mods to back out aggressive FFFE detection. - Jan 2004: updated switches in from-UTF8 conversions. - Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. - - See the header file "ConvertUTF.h" for complete documentation. - ------------------------------------------------------------------------- */ - - -#include <IceE/ConvertUTF.h> - -#ifdef CVTUTF_DEBUG -#include <stdio.h> -#endif - -namespace IceUtil -{ - -static const int halfShift = 10; /* used for shifting by 10 bits */ - -static const UTF32 halfBase = 0x0010000UL; -static const UTF32 halfMask = 0x3FFUL; - -#define UNI_SUR_HIGH_START (UTF32)0xD800 -#define UNI_SUR_HIGH_END (UTF32)0xDBFF -#define UNI_SUR_LOW_START (UTF32)0xDC00 -#define UNI_SUR_LOW_END (UTF32)0xDFFF -// #define false 0 -// #define true 1 - - -/* --------------------------------------------------------------------- */ - -/* - * Index into the table below with the first byte of a UTF-8 sequence to - * get the number of trailing bytes that are supposed to follow it. - * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is - * left as-is for anyone who may want to do such conversion, which was - * allowed in earlier algorithms. - */ -static const char trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -/* - * Magic values subtracted from a buffer value during UTF8 conversion. - * This table contains as many values as there might be trailing bytes - * in a UTF-8 sequence. - */ -static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; - -/* - * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed - * into the first byte, depending on how many bytes follow. There are - * as many entries in this table as there are UTF-8 sequence types. - * (I.e., one byte sequence, two byte... etc.). Remember that sequencs - * for *legal* UTF-8 will be 4 or fewer bytes total. - */ -static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - -/* --------------------------------------------------------------------- */ - -/* The interface converts a whole buffer to avoid function-call overhead. - * Constants have been gathered. Loops & conditionals have been removed as - * much as possible for efficiency, in favor of drop-through switches. - * (See "Note A" at the bottom of the file for equivalent code.) - * If your compiler supports it, the "isLegalUTF8" call can be turned - * into an inline function. - */ - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF16toUTF8 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF16* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ - ch = *source++; - /* If we have a surrogate pair, convert to UTF32 first. */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - /* If the 16 bits following the high surrogate are in the source buffer... */ - if (source < sourceEnd) { - UTF32 ch2 = *source; - /* If it's a low surrogate, convert to UTF32. */ - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - ++source; - } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } else { /* We don't have the 16 bits following the high surrogate. */ - --source; /* return to the high surrogate */ - result = sourceExhausted; - break; - } - } else if (flags == strictConversion) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* Figure out how many bytes the result will require */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - } - - target += bytesToWrite; - if (target > targetEnd) { - source = oldSource; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -/* - * Utility routine to tell whether a sequence of bytes is legal UTF-8. - * This must be called with the length pre-determined by the first byte. - * If not calling this from ConvertUTF8to*, then the length can be set by: - * length = trailingBytesForUTF8[*source]+1; - * and the sequence is illegal right away if there aren't that many bytes - * available. - * If presented with a length > 4, this returns false. The Unicode - * definition of UTF-8 goes up to 4-byte sequences. - */ - -static Boolean isLegalUTF8(const UTF8 *source, int length) { - UTF8 a; - const UTF8 *srcptr = source+length; - switch (length) { - default: return false; - /* Everything else falls through when "true"... */ - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 2: if ((a = (*--srcptr)) > 0xBF) return false; - - switch (*source) { - /* no fall-through in this inner switch */ - case 0xE0: if (a < 0xA0) return false; break; - case 0xED: if (a > 0x9F) return false; break; - case 0xF0: if (a < 0x90) return false; break; - case 0xF4: if (a > 0x8F) return false; break; - default: if (a < 0x80) return false; - } - - case 1: if (*source >= 0x80 && *source < 0xC2) return false; - } - if (*source > 0xF4) return false; - return true; -} - -/* --------------------------------------------------------------------- */ - -/* - * Exported function to return whether a UTF-8 sequence is legal or not. - * This is not used here; it's just exported. - */ -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { - if(source == sourceEnd) { - return true; - } - while(true) { - int length = trailingBytesForUTF8[*source]+1; - // Is buffer big enough to contain character? - if (source+length > sourceEnd) { - return false; - } - // Is character legal UTF8? - if(!isLegalUTF8(source, length)) { - return false; - } - // Are we at end of buffer? - source += length; - if(source == sourceEnd) { - return true; - } - } -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF16 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF16* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = (UTF16)ch; /* normal case */ - } - } else if (ch > UNI_MAX_UTF16) { - if (flags == strictConversion) { - result = sourceIllegal; - source -= (extraBytesToRead+1); /* return to the start */ - break; /* Bail out; shouldn't continue */ - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - /* target is a character in range 0xFFFF - 0x10FFFF. */ - if (target + 1 >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - ch -= halfBase; - *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); - *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF32toUTF8 ( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF32* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - ch = *source++; - if (flags == strictConversion ) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* - * Figure out how many bytes the result will require. Turn any - * illegally large UTF32 things (> Plane 17) into replacement chars. - */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - result = sourceIllegal; - } - - target += bytesToWrite; - if (target > targetEnd) { - --source; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF32 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF32* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; - case 4: ch += *source++; ch <<= 6; - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up the source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_LEGAL_UTF32) { - /* - * UTF-16 surrogate values are illegal in UTF-32, and anything - * over Plane 17 (> 0x10FFFF) is illegal. - */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = ch; - } - } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ - result = sourceIllegal; - *target++ = UNI_REPLACEMENT_CHAR; - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- - - Note A. - The fall-through switches in UTF-8 reading code save a - temp variable, some decrements & conditionals. The switches - are equivalent to the following loop: - { - int tmpBytesToRead = extraBytesToRead+1; - do { - ch += *source++; - --tmpBytesToRead; - if (tmpBytesToRead) ch <<= 6; - } while (tmpBytesToRead > 0); - } - In UTF-8 writing code, the switches on "bytesToWrite" are - similarly unrolled loops. - - --------------------------------------------------------------------- */ -} - -#endif diff --git a/cppe/src/IceE/ConvertUTF.h b/cppe/src/IceE/ConvertUTF.h deleted file mode 100644 index 4a1445937aa..00000000000 --- a/cppe/src/IceE/ConvertUTF.h +++ /dev/null @@ -1,146 +0,0 @@ -#include <IceE/Config.h> - -/* - * Copyright 2001-2004 Unicode, Inc. - * - * Disclaimer - * - * This source code is provided as is by Unicode, Inc. No claims are - * made as to fitness for any particular purpose. No warranties of any - * kind are expressed or implied. The recipient agrees to determine - * applicability of information provided. If this file has been - * purchased on magnetic or optical media from Unicode, Inc., the - * sole remedy for any claim will be exchange of defective media - * within 90 days of receipt. - * - * Limitations on Rights to Redistribute This Code - * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form - * for internal or external distribution as long as this notice - * remains attached. - */ - -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_CONVERT_UTF_H -#define ICEE_CONVERT_UTF_H - -#include <IceE/Unicode.h> - - -/* --------------------------------------------------------------------- - - Conversions between UTF32, UTF-16, and UTF-8. Header file. - - Several funtions are included here, forming a complete set of - conversions between the three formats. UTF-7 is not included - here, but is handled in a separate source file. - - Each of these routines takes pointers to input buffers and output - buffers. The input buffers are const. - - Each routine converts the text between *sourceStart and sourceEnd, - putting the result into the buffer between *targetStart and - targetEnd. Note: the end pointers are *after* the last item: e.g. - *(sourceEnd - 1) is the last item. - - The return result indicates whether the conversion was successful, - and if not, whether the problem was in the source or target buffers. - (Only the first encountered problem is indicated.) - - After the conversion, *sourceStart and *targetStart are both - updated to point to the end of last text successfully converted in - the respective buffers. - - Input parameters: - sourceStart - pointer to a pointer to the source buffer. - The contents of this are modified on return so that - it points at the next thing to be converted. - targetStart - similarly, pointer to pointer to the target buffer. - sourceEnd, targetEnd - respectively pointers to the ends of the - two buffers, for overflow checking only. - - These conversion functions take a ConversionFlags argument. When this - flag is set to strict, both irregular sequences and isolated surrogates - will cause an error. When the flag is set to lenient, both irregular - sequences and isolated surrogates are converted. - - Whether the flag is strict or lenient, all illegal sequences will cause - an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>, - or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code - must check for illegal sequences. - - When the flag is set to lenient, characters over 0x10FFFF are converted - to the replacement character; otherwise (when the flag is set to strict) - they constitute an error. - - Output parameters: - The value "sourceIllegal" is returned from some routines if the input - sequence is malformed. When "sourceIllegal" is returned, the source - value will point to the illegal value that caused the problem. E.g., - in UTF-8 when a sequence is malformed, it points to the start of the - malformed sequence. - - Author: Mark E. Davis, 1994. - Rev History: Rick McGowan, fixes & updates May 2001. - Fixes & updates, Sept 2001. - ------------------------------------------------------------------------- */ - -/* --------------------------------------------------------------------- - The following 4 definitions are compiler-specific. - The C standard does not guarantee that wchar_t has at least - 16 bits, so wchar_t is no less portable than unsigned short! - All should be unsigned values to avoid sign extension during - bit mask & shift operations. ------------------------------------------------------------------------- */ - -namespace IceUtil -{ - -typedef unsigned int UTF32; /* at least 32 bits */ -typedef unsigned short UTF16; /* at least 16 bits */ -typedef unsigned char UTF8; /* typically 8 bits */ -typedef bool Boolean; /* 0 or 1 */ - -/* Some fundamental constants */ -#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD -#define UNI_MAX_BMP (UTF32)0x0000FFFF -#define UNI_MAX_UTF16 (UTF32)0x0010FFFF -#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF -#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF - - -ConversionResult ConvertUTF8toUTF16( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF16toUTF8 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF8toUTF32( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF32toUTF8( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -// -// isLegalUTFSequence is declared in IceUtil/Unicode.h -// - -/* --------------------------------------------------------------------- */ - -} -#endif diff --git a/cppe/src/IceE/Current.cpp b/cppe/src/IceE/Current.cpp deleted file mode 100644 index d556881f11c..00000000000 --- a/cppe/src/IceE/Current.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Current.h> - -bool -Ice::Current::operator==(const Current& __rhs) const -{ - return !operator!=(__rhs); -} - -bool -Ice::Current::operator!=(const Current& __rhs) const -{ - if(this == &__rhs) - { - return false; - } - if(adapter != __rhs.adapter) - { - return true; - } - if(con != __rhs.con) - { - return true; - } - if(id != __rhs.id) - { - return true; - } - if(facet != __rhs.facet) - { - return true; - } - if(operation != __rhs.operation) - { - return true; - } - if(mode != __rhs.mode) - { - return true; - } - if(ctx != __rhs.ctx) - { - return true; - } - return false; -} - -bool -Ice::Current::operator<(const Current& __rhs) const -{ - if(this == &__rhs) - { - return false; - } - if(adapter < __rhs.adapter) - { - return true; - } - else if(__rhs.adapter < adapter) - { - return false; - } - if(con < __rhs.con) - { - return true; - } - else if(__rhs.con < con) - { - return false; - } - if(id < __rhs.id) - { - return true; - } - else if(__rhs.id < id) - { - return false; - } - if(facet < __rhs.facet) - { - return true; - } - else if(__rhs.facet < facet) - { - return false; - } - if(operation < __rhs.operation) - { - return true; - } - else if(__rhs.operation < operation) - { - return false; - } - if(mode < __rhs.mode) - { - return true; - } - else if(__rhs.mode < mode) - { - return false; - } - if(ctx < __rhs.ctx) - { - return true; - } - else if(__rhs.ctx < ctx) - { - return false; - } - return false; -} diff --git a/cppe/src/IceE/DefaultsAndOverrides.cpp b/cppe/src/IceE/DefaultsAndOverrides.cpp deleted file mode 100644 index 75355f6eb22..00000000000 --- a/cppe/src/IceE/DefaultsAndOverrides.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DefaultsAndOverrides.h> -#include <IceE/Properties.h> -#include <IceE/Network.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(DefaultsAndOverrides* p) { return p; } - -IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& properties) : - overrideTimeout(false), - overrideTimeoutValue(-1), - overrideConnectTimeout(false), - overrideConnectTimeoutValue(-1) -{ - const_cast<string&>(defaultHost) = properties->getProperty("Ice.Default.Host"); - -#ifdef ICEE_HAS_ROUTER - const_cast<string&>(defaultRouter) = properties->getProperty("Ice.Default.Router"); -#endif - - string value; - - value = properties->getProperty("Ice.Override.Timeout"); - if(!value.empty()) - { - const_cast<bool&>(overrideTimeout) = true; - const_cast<Int&>(overrideTimeoutValue) = properties->getPropertyAsInt("Ice.Override.Timeout"); - } - - value = properties->getProperty("Ice.Override.ConnectTimeout"); - if(!value.empty()) - { - const_cast<bool&>(overrideConnectTimeout) = true; - const_cast<Int&>(overrideConnectTimeoutValue) = properties->getPropertyAsInt("Ice.Override.ConnectTimeout"); - } - -#ifdef ICEE_HAS_LOCATOR - const_cast<string&>(defaultLocator) = properties->getProperty("Ice.Default.Locator"); -#endif -} diff --git a/cppe/src/IceE/DefaultsAndOverrides.h b/cppe/src/IceE/DefaultsAndOverrides.h deleted file mode 100644 index dfb37431507..00000000000 --- a/cppe/src/IceE/DefaultsAndOverrides.h +++ /dev/null @@ -1,42 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_DEFAULTS_AND_OVERRIDES_H -#define ICEE_DEFAULTS_AND_OVERRIDES_H - -#include <IceE/DefaultsAndOverridesF.h> -#include <IceE/PropertiesF.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class DefaultsAndOverrides : public ::IceUtil::Shared -{ -public: - - DefaultsAndOverrides(const ::Ice::PropertiesPtr&); - - std::string defaultHost; -#ifdef ICEE_HAS_ROUTER - std::string defaultRouter; -#endif -#ifdef ICEE_HAS_LOCATOR - std::string defaultLocator; -#endif - - bool overrideTimeout; - Ice::Int overrideTimeoutValue; - bool overrideConnectTimeout; - Ice::Int overrideConnectTimeoutValue; -}; - -} - -#endif diff --git a/cppe/src/IceE/DefaultsAndOverridesF.h b/cppe/src/IceE/DefaultsAndOverridesF.h deleted file mode 100644 index c54066fa2f7..00000000000 --- a/cppe/src/IceE/DefaultsAndOverridesF.h +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_DEFAULTS_AND_OVERRIDES_F_H -#define ICEE_DEFAULTS_AND_OVERRIDES_F_H - -#include <IceE/Handle.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class DefaultsAndOverrides; -IceUtil::Shared* upCast(DefaultsAndOverrides*); -typedef Handle<DefaultsAndOverrides> DefaultsAndOverridesPtr; - -} - -#endif diff --git a/cppe/src/IceE/Endpoint.cpp b/cppe/src/IceE/Endpoint.cpp deleted file mode 100644 index 4f1c8ae59c0..00000000000 --- a/cppe/src/IceE/Endpoint.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Endpoint.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Endpoint* p) { return p; } diff --git a/cppe/src/IceE/Endpoint.h b/cppe/src/IceE/Endpoint.h deleted file mode 100644 index 1026c1d0cd4..00000000000 --- a/cppe/src/IceE/Endpoint.h +++ /dev/null @@ -1,117 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ENDPOINT_H -#define ICEE_ENDPOINT_H - -#include <IceE/EndpointF.h> -#include <IceE/ConnectorF.h> -#include <IceE/TransceiverF.h> -#include <IceE/InstanceF.h> - -#ifndef ICEE_PURE_CLIENT -# include <IceE/AcceptorF.h> -#endif - -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class BasicStream; - -class Endpoint : public IceUtil::Shared -{ -public: - - // - // Marshal the endpoint. - // - virtual void streamWrite(BasicStream*) const = 0; - - // - // Convert the endpoint to its string form. - // - virtual std::string toString() const = 0; - - // - // Return the endpoint type. - // - virtual Ice::Short type() const = 0; - - // - // Return the timeout for the endpoint in milliseconds. 0 means - // non-blocking, -1 means no timeout. - // - virtual Ice::Int timeout() const = 0; - - // - // Return a new endpoint with a different timeout value, provided - // that timeouts are supported by the endpoint. Otherwise the same - // endpoint is returned. - // - virtual EndpointPtr timeout(Ice::Int) const = 0; - - // - // Return true if the endpoint is datagram-based. - // - virtual bool datagram() const = 0; - - // - // Return true if the endpoint is secure. - // - virtual bool secure() const = 0; - - // - // Return true if the endpoint type is unknown. - // - virtual bool unknown() const = 0; - - // - // Return a connector for this endpoint, or null if no connector - // is available. - // - virtual ConnectorPtr connector() const = 0; - - // - // Return an acceptor for this endpoint, or null if no acceptors - // is available. In case an acceptor is created, this operation - // also returns a new "effective" endpoint, which might differ - // from this endpoint, for example, if a dynamic port number is - // assigned. - // -#ifndef ICEE_PURE_CLIENT - virtual AcceptorPtr acceptor(EndpointPtr&) const = 0; -#endif - - // - // Expand endpoint out in to separate endpoints for each local - // host if endpoint was configured with no host set. - // - virtual std::vector<EndpointPtr> expand(bool) const = 0; - - // - // Return whether the endpoint should be published in proxies - // created by the Object Adapter. - // -#ifndef ICEE_PURE_CLIENT - virtual bool publish() const = 0; -#endif - - // - // Compare endpoints for sorting purposes. - // - virtual bool operator==(const Endpoint&) const = 0; - virtual bool operator!=(const Endpoint&) const = 0; - virtual bool operator<(const Endpoint&) const = 0; -}; - -} - -#endif diff --git a/cppe/src/IceE/EndpointFactory.h b/cppe/src/IceE/EndpointFactory.h deleted file mode 100644 index 2c911d7b81d..00000000000 --- a/cppe/src/IceE/EndpointFactory.h +++ /dev/null @@ -1,43 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ENDPOINT_FACTORY_H -#define ICEE_ENDPOINT_FACTORY_H - -#include <IceE/EndpointFactoryF.h> -#include <IceE/EndpointF.h> -#include <IceE/InstanceF.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class BasicStream; - -class EndpointFactory : public ::IceUtil::Shared -{ -public: - - ~EndpointFactory(); - - EndpointPtr create(const std::string&) const; - EndpointPtr read(BasicStream*) const; - void destroy(); - -protected: - - EndpointFactory(const InstancePtr&); - friend class Instance; - - InstancePtr _instance; -}; - -} - -#endif diff --git a/cppe/src/IceE/EndpointFactoryF.h b/cppe/src/IceE/EndpointFactoryF.h deleted file mode 100644 index 96a2f96bae8..00000000000 --- a/cppe/src/IceE/EndpointFactoryF.h +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ENDPOINT_FACTORY_F_H -#define ICEE_ENDPOINT_FACTORY_F_H - -#include <IceE/Handle.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class EndpointFactory; -IceUtil::Shared* upCast(EndpointFactory*); -typedef Handle<EndpointFactory> EndpointFactoryPtr; - -} - -#endif diff --git a/cppe/src/IceE/ExceptionBase.cpp b/cppe/src/IceE/ExceptionBase.cpp deleted file mode 100644 index a7728cf4396..00000000000 --- a/cppe/src/IceE/ExceptionBase.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Exception.h> -#include <IceE/SafeStdio.h> -#include <IceE/StaticMutex.h> - -using namespace std; - -namespace IceUtil -{ - -bool nullHandleAbort = false; - -}; - -IceUtil::Exception::Exception() : - _file(0), - _line(0) -{ -} - -IceUtil::Exception::Exception(const char* file, int line) : - _file(file), - _line(line) -{ -} - -IceUtil::Exception::~Exception() throw() -{ -} - -const char* IceUtil::Exception::_name = "IceUtil::Exception"; - -string -IceUtil::Exception::ice_name() const -{ - return _name; -} - -string -IceUtil::Exception::toString() const -{ - string out; - if(_file && _line > 0) - { - out += Ice::printfToString("%s:%d: ", _file, _line); - } - out += ice_name(); - return out; -} - -const char* -IceUtil::Exception::what() const throw() -{ - StaticMutex::Lock lock(globalMutex); - { - if(_str.empty()) - { - _str = toString(); // Lazy initialization. - } - } - return _str.c_str(); -} - -IceUtil::Exception* -IceUtil::Exception::ice_clone() const -{ - return new Exception(*this); -} - -void -IceUtil::Exception::ice_throw() const -{ - throw *this; -} - -const char* -IceUtil::Exception::ice_file() const -{ - return _file; -} - -int -IceUtil::Exception::ice_line() const -{ - return _line; -} - -IceUtil::NullHandleException::NullHandleException(const char* file, int line) : - Exception(file, line) -{ - if(nullHandleAbort) - { -#ifdef _WIN32_WCE - // - // WinCE does not appear to have abort() - // - exit(-1); -#else - abort(); -#endif - } -} - -IceUtil::NullHandleException::~NullHandleException() throw() -{ -} - -const char* IceUtil::NullHandleException::_name = "IceUtil::NullHandleException"; - -string -IceUtil::NullHandleException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::NullHandleException::ice_clone() const -{ - return new NullHandleException(*this); -} - -void -IceUtil::NullHandleException::ice_throw() const -{ - throw *this; -} - -IceUtil::IllegalArgumentException::IllegalArgumentException(const char* file, int line) : - Exception(file, line) -{ -} - -IceUtil::IllegalArgumentException::IllegalArgumentException(const char* file, int line, const string& r) : - Exception(file, line), - reason(r) -{ -} - -IceUtil::IllegalArgumentException::~IllegalArgumentException() throw() -{ -} - -const char* IceUtil::IllegalArgumentException::_name = "IceUtil::IllegalArgumentException"; - -string -IceUtil::IllegalArgumentException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::IllegalArgumentException::ice_clone() const -{ - return new IllegalArgumentException(*this); -} - -void -IceUtil::IllegalArgumentException::ice_throw() const -{ - throw *this; -} diff --git a/cppe/src/IceE/FactoryTable.cpp b/cppe/src/IceE/FactoryTable.cpp deleted file mode 100644 index d3539b91db3..00000000000 --- a/cppe/src/IceE/FactoryTable.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/FactoryTable.h> -#include <IceE/UserExceptionFactory.h> - -// -// This constructor initializes the single global Ice::factoryTable instance -// from the outside (if it hasn't been initialized yet). The constructor here -// is triggered by a file-static instance of FactoryTable in each -// slice2cpp-generated header file that uses non-local exceptions or non-abstract classes. -// This ensures that Ice::factoryTable is always initialized before it is used. -// -IceInternal::FactoryTable::FactoryTable() -{ - - IceInternal::factoryTableWrapper.initialize(); -} - -// -// Similarly, the destructor calls the finalize() method on the factory table wrapper which, -// once the tables reference count drops to zero, deletes the table. -// -IceInternal::FactoryTable::~FactoryTable() -{ - IceInternal::factoryTableWrapper.finalize(); -} diff --git a/cppe/src/IceE/FactoryTableDef.cpp b/cppe/src/IceE/FactoryTableDef.cpp deleted file mode 100644 index 67d2e89a67a..00000000000 --- a/cppe/src/IceE/FactoryTableDef.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/FactoryTableDef.h> -#include <IceE/UserExceptionFactory.h> - -#ifdef __APPLE__ -# include <dlfcn.h> -#endif - -namespace IceInternal -{ - -FactoryTableWrapper factoryTableWrapper; // Single global instance of the wrapper object that - // initializes factoryTable. - -ICE_API FactoryTableDef* factoryTable; // Single global instance of the factory table for - // non-local exceptions and non-abstract classes -} - -// -// Add a factory to the exception factory table. -// If the factory is present already, increment its reference count. -// -void -IceInternal::FactoryTableDef::addExceptionFactory(const std::string& t, const IceInternal::UserExceptionFactoryPtr& f) -{ - IceUtil::Mutex::Lock lock(_m); - EFTable::iterator i = _eft.find(t); - if(i == _eft.end()) - { - _eft[t] = EFPair(f, 1); - } - else - { - i->second.second++; - } -} - -// -// Return the exception factory for a given type ID -// -IceInternal::UserExceptionFactoryPtr -IceInternal::FactoryTableDef::getExceptionFactory(const std::string& t) const -{ - IceUtil::Mutex::Lock lock(_m); - EFTable::const_iterator i = _eft.find(t); -#ifdef __APPLE__ - if(i == _eft.end()) - { - lock.release(); - - // - // Try to find the symbol, if found this should trigger the - // object static constructors to be called. - // - std::string symbol = "__F"; - for(std::string::const_iterator p = t.begin(); p != t.end(); ++p) - { - symbol += ((*p) == ':') ? '_' : *p; - } - symbol += "__initializer"; - dlsym(RTLD_DEFAULT, symbol.c_str()); - - lock.acquire(); - - i = _eft.find(t); - } -#endif - return i != _eft.end() ? i->second.first : IceInternal::UserExceptionFactoryPtr(); -} - -// -// Remove a factory from the exception factory table. If the factory -// is not present, do nothing; otherwise, decrement the factory's -// reference count; if the count drops to zero, remove the factory's -// entry from the table. -// -void -IceInternal::FactoryTableDef::removeExceptionFactory(const std::string& t) -{ - IceUtil::Mutex::Lock lock(_m); - EFTable::iterator i = _eft.find(t); - if(i != _eft.end()) - { - if(--i->second.second == 0) - { - _eft.erase(i); - } - } -} - -// -// The code generated by slice2cpp contains a file static instance of FactoryTable. -// The constructor of FactoryTable calls initialize(), as does the constructor of -// FactoryTableWrapper. This ensures that the global factoryTable variable is initialized -// before it can be used, regardless of the order of initialization of global objects. -// -IceInternal::FactoryTableWrapper::FactoryTableWrapper() -{ - initialize(); -} - -IceInternal::FactoryTableWrapper::~FactoryTableWrapper() -{ - finalize(); -} - -// -// Initialize the single global instance of the factory table, counting -// the number of calls made. -// -void -IceInternal::FactoryTableWrapper::initialize() -{ - IceUtil::StaticMutex::Lock lock(_m); - if(_initCount == 0) - { - factoryTable = new FactoryTableDef; - } - ++_initCount; -} - -// -// Delete the table if its reference count drops to zero. -// -void -IceInternal::FactoryTableWrapper::finalize() -{ - IceUtil::StaticMutex::Lock lock(_m); - if(--_initCount == 0) - { - delete factoryTable; - } -} - -IceUtil::StaticMutex IceInternal::FactoryTableWrapper::_m = ICE_STATIC_MUTEX_INITIALIZER; -int IceInternal::FactoryTableWrapper::_initCount = 0; // Initialization count diff --git a/cppe/src/IceE/Incoming.cpp b/cppe/src/IceE/Incoming.cpp deleted file mode 100644 index 610ec737b19..00000000000 --- a/cppe/src/IceE/Incoming.cpp +++ /dev/null @@ -1,500 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Incoming.h> -#include <IceE/ServantManager.h> -#include <IceE/Object.h> -#include <IceE/ReplyStatus.h> -#include <IceE/Connection.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/Properties.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Protocol.h> -#include <IceE/StringUtil.h> -#include <IceE/ObjectAdapter.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceInternal::Incoming::Incoming(Instance* inst, Connection* con, BasicStream& is, const ObjectAdapterPtr& adapter) : - _os(inst, inst->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , inst->initializationData().stringConverter, inst->initializationData().wstringConverter -#endif - ), - _is(is), - _connection(con) -{ - setAdapter(adapter); - - _current.con = con; - _current.adapter = adapter.get(); -} - -void -IceInternal::Incoming::setAdapter(const Ice::ObjectAdapterPtr& adapter) -{ - _adapter = adapter; - if(_adapter) - { - _servantManager = _adapter->getServantManager().get(); - if(!_servantManager) - { - _adapter = 0; - } - } - else - { - _servantManager = 0; - } -} - -void -IceInternal::Incoming::invoke(bool response, Int requestId) -{ - assert(_adapter && _servantManager); - - _current.requestId = requestId; - - // - // Clear the context from the previous invocation. - // - _current.ctx.clear(); - - // - // Read the current. - // - //_current.id.__read(&_is); - _is.read(_current.id.name); // Directly read name for performance reasons. - _is.read(_current.id.category); // Directly read category for performance reasons. - - // - // For compatibility with the old FacetPath. Note that we don't use - // the stream read vector method for performance reasons. - // -// vector<string> facetPath; -// _is.read(facetPath); -// string facet; -// if(!facetPath.empty()) -// { -// if(facetPath.size() > 1) -// { -// throw MarshalException(__FILE__, __LINE__); -// } -// facet.swap(facetPath[0]); -// } -// _current.facet.swap(facet); - Int sz; - _is.readSize(sz); - if(sz > 0) - { - if(sz > 1) - { - throw MarshalException(__FILE__, __LINE__); - } - _is.read(_current.facet); - } - else - { - _current.facet.clear(); - } - - _is.read(_current.operation, false); - - Byte b; - _is.read(b); - _current.mode = static_cast<OperationMode>(b); - - _is.readSize(sz); - while(sz--) - { - pair<const string, string> pr; - _is.read(const_cast<string&>(pr.first)); - _is.read(pr.second); - _current.ctx.insert(_current.ctx.end(), pr); - } - - _is.startReadEncaps(); - - if(response) - { - assert(_os.b.size() == headerSize + 4); // Reply status position. - _os.write(replyOK); - _os.startWriteEncaps(); - } - - - Byte replyStatus = replyOK; - DispatchStatus dispatchStatus = DispatchOK; - - // - // Don't put the code above into the try block below. Exceptions - // in the code above are considered fatal, and must propagate to - // the caller of this operation. - // - - try - { - Ice::ObjectPtr servant; - if(_servantManager) - { - servant = _servantManager->findServant(_current.id, _current.facet); - } - - if(!servant) - { - if(_servantManager && _servantManager->hasServant(_current.id)) - { - replyStatus = replyFacetNotExist; - } - else - { - replyStatus = replyObjectNotExist; - } - } - else - { - dispatchStatus = servant->__dispatch(*this, _current); - if(dispatchStatus == DispatchUserException) - { - replyStatus = replyUserException; - } - } - } - catch(RequestFailedException& ex) - { - _is.endReadEncaps(); - - if(ex.id.name.empty()) - { - ex.id = _current.id; - } - - if(ex.facet.empty() && !_current.facet.empty()) - { - ex.facet = _current.facet; - } - - if(ex.operation.empty() && !_current.operation.empty()) - { - ex.operation = _current.operation; - } - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 1) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - if(dynamic_cast<ObjectNotExistException*>(&ex)) - { - _os.write(replyObjectNotExist); - } - else if(dynamic_cast<FacetNotExistException*>(&ex)) - { - _os.write(replyFacetNotExist); - } - else if(dynamic_cast<OperationNotExistException*>(&ex)) - { - _os.write(replyOperationNotExist); - } - else - { - assert(false); - } - - ex.id.__write(&_os); - - // - // For compatibility with the old FacetPath. - // - if(ex.facet.empty()) - { - _os.write(static_cast<string*>(0), static_cast<string*>(0)); - } - else - { - _os.write(&ex.facet, &ex.facet + 1); - } - - _os.write(ex.operation, false); - - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const UnknownLocalException& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownLocalException); - _os.write(ex.unknown, false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const UnknownUserException& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownUserException); - _os.write(ex.unknown, false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const UnknownException& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownException); - _os.write(ex.unknown, false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const LocalException& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownLocalException); - _os.write(ex.toString(), false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const UserException& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownUserException); - _os.write(ex.toString(), false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const Exception& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(ex); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownException); - _os.write(ex.toString(), false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(const std::exception& ex) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning(string("std::exception: ") + ex.what()); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownException); - string msg = string("std::exception: ") + ex.what(); - _os.write(msg, false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - catch(...) - { - _is.endReadEncaps(); - - if(_os.instance()->initializationData().properties->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0) - { - __warning("unknown c++ exception"); - } - - if(response) - { - _os.endWriteEncaps(); - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyUnknownException); - _os.write(string("unknown c++ exception"), false); - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } - - return; - } - - // - // Don't put the code below into the try block above. Exceptions - // in the code below are considered fatal, and must propagate to - // the caller of this operation. - // - - _is.endReadEncaps(); - - if(response) - { - _os.endWriteEncaps(); - - if(replyStatus != replyOK && replyStatus != replyUserException) - { - assert(replyStatus == replyObjectNotExist || - replyStatus == replyFacetNotExist); - - _os.b.resize(headerSize + 4); // Reply status position. - _os.write(replyStatus); - - _current.id.__write(&_os); - - // - // For compatibility with the old FacetPath. - // - if(_current.facet.empty()) - { - _os.write(static_cast<string*>(0), static_cast<string*>(0)); - } - else - { - _os.write(&_current.facet, &_current.facet + 1); - } - - _os.write(_current.operation, false); - } - else - { - *(_os.b.begin() + headerSize + 4) = replyStatus; // Reply status position. - } - - _connection->sendResponse(&_os); - } - else - { - _connection->sendNoResponse(); - } -} - -void -IceInternal::Incoming::__warning(const Exception& ex) const -{ - __warning(ex.toString()); -} - -void -IceInternal::Incoming::__warning(const string& msg) const -{ - Warning out(_os.instance()->initializationData().logger); - out << "dispatch exception: " << msg; - out << "\nidentity: " << _os.instance()->identityToString(_current.id); - out << "\nfacet: " << IceUtil::escapeString(_current.facet, ""); - out << "\noperation: " << _current.operation; -} - diff --git a/cppe/src/IceE/IncomingConnectionFactory.cpp b/cppe/src/IceE/IncomingConnectionFactory.cpp deleted file mode 100644 index 652836012b4..00000000000 --- a/cppe/src/IceE/IncomingConnectionFactory.cpp +++ /dev/null @@ -1,437 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/IncomingConnectionFactory.h> -#include <IceE/Connection.h> -#include <IceE/Instance.h> -#include <IceE/LoggerUtil.h> -#include <IceE/TraceLevels.h> -#include <IceE/DefaultsAndOverrides.h> -#include <IceE/Properties.h> -#include <IceE/Transceiver.h> -#include <IceE/Acceptor.h> -#include <IceE/Endpoint.h> -#include <IceE/LocalException.h> -#include <IceE/Functional.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(IncomingConnectionFactory* p) { return p; } - -void -IceInternal::IncomingConnectionFactory::activate() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateActive); -} - -void -IceInternal::IncomingConnectionFactory::hold() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateHolding); -} - -void -IceInternal::IncomingConnectionFactory::destroy() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - setState(StateClosed); -} - -void -IceInternal::IncomingConnectionFactory::waitUntilHolding() const -{ - list<ConnectionPtr> connections; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // First we wait until the connection factory itself is in holding - // state. - // - while(_state < StateHolding) - { - wait(); - } - - // - // We want to wait until all connections are in holding state - // outside the thread synchronization. - // - connections = _connections; - } - - // - // Now we wait until each connection is in holding state. - // - for_each(connections.begin(), connections.end(), Ice::constVoidMemFun(&Connection::waitUntilHolding)); -} - -void -IceInternal::IncomingConnectionFactory::waitUntilFinished() -{ - IceUtil::ThreadPtr threadPerIncomingConnectionFactory; - list<ConnectionPtr> connections; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // First we wait until the factory is destroyed. If we are using - // an acceptor, we also wait for it to be closed. - // - while(_state != StateClosed || _acceptor) - { - wait(); - } - - threadPerIncomingConnectionFactory = _threadPerIncomingConnectionFactory; - _threadPerIncomingConnectionFactory = 0; - - // - // We want to wait until all connections are finished outside the - // thread synchronization. - // - connections.swap(_connections); - } - - if(threadPerIncomingConnectionFactory) - { - threadPerIncomingConnectionFactory->getThreadControl().join(); - } - - for_each(connections.begin(), connections.end(), Ice::voidMemFun(&Connection::waitUntilFinished)); -} - -EndpointPtr -IceInternal::IncomingConnectionFactory::endpoint() const -{ - // No mutex protection necessary, _endpoint is immutable. - return _endpoint; -} - -list<ConnectionPtr> -IceInternal::IncomingConnectionFactory::connections() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - list<ConnectionPtr> result; - - // - // Only copy connections which have not been destroyed. - // - remove_copy_if(_connections.begin(), _connections.end(), back_inserter(result), - Ice::constMemFun(&Connection::isDestroyed)); - - return result; -} - -void -IceInternal::IncomingConnectionFactory::flushBatchRequests() -{ - list<ConnectionPtr> c = connections(); // connections() is synchronized, so no need to synchronize here. - - for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p) - { - try - { - (*p)->flushBatchRequests(); - } - catch(const LocalException&) - { - // Ignore. - } - } -} - -string -IceInternal::IncomingConnectionFactory::toString() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_transceiver) - { - return _transceiver->toString(); - } - - assert(_acceptor); - return _acceptor->toString(); -} - -IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const InstancePtr& instance, - const EndpointPtr& endpoint, - const ObjectAdapterPtr& adapter) : - _instance(instance), - _endpoint(endpoint), - _adapter(adapter), - _warn(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Connections") > 0), - _state(StateHolding) -{ - if(_instance->defaultsAndOverrides()->overrideTimeout) - { - const_cast<EndpointPtr&>(_endpoint) = - _endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue); - } - - _acceptor = _endpoint->acceptor(const_cast<EndpointPtr&>(_endpoint)); - assert(_acceptor); - _acceptor->listen(); - - __setNoDelete(true); - try - { - // - // If we are in thread per connection mode, we also use one - // thread per incoming connection factory, that accepts new - // connections on this endpoint. - // - _threadPerIncomingConnectionFactory = new ThreadPerIncomingConnectionFactory(this); - _threadPerIncomingConnectionFactory->start(_instance->threadPerConnectionStackSize()); - } - catch(const Ice::Exception& ex) - { - { - Error out(_instance->initializationData().logger); - out << "cannot create thread for incoming connection factory:\n" << ex.toString(); - } - - try - { - _acceptor->close(); - } - catch(const LocalException&) - { - // Here we ignore any exceptions in close(). - } - - _state = StateClosed; - _acceptor = 0; - _threadPerIncomingConnectionFactory = 0; - - __setNoDelete(false); - ex.ice_throw(); - } - __setNoDelete(false); -} - -IceInternal::IncomingConnectionFactory::~IncomingConnectionFactory() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - assert(_state == StateClosed); - assert(!_acceptor); - assert(_connections.empty()); - assert(!_threadPerIncomingConnectionFactory); -} - -void -IceInternal::IncomingConnectionFactory::setState(State state) -{ - if(_state == state) // Don't switch twice. - { - return; - } - - switch(state) - { - case StateActive: - { - if(_state != StateHolding) // Can only switch from holding to active. - { - return; - } - for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::activate)); - break; - } - - case StateHolding: - { - if(_state != StateActive) // Can only switch from active to holding. - { - return; - } - for_each(_connections.begin(), _connections.end(), Ice::voidMemFun(&Connection::hold)); - break; - } - - case StateClosed: - { - if(_acceptor) - { - // - // Connect to our own acceptor, which unblocks our - // thread per incoming connection factory stuck in accept(). - // - _acceptor->connectToSelf(); - } - -#ifdef _STLP_BEGIN_NAMESPACE - // voidbind2nd is an STLport extension for broken compilers in IceE/Functional.h - for_each(_connections.begin(), _connections.end(), - voidbind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated)); -#else - for_each(_connections.begin(), _connections.end(), - bind2nd(Ice::voidMemFun1(&Connection::destroy), Connection::ObjectAdapterDeactivated)); -#endif - break; - } - } - - _state = state; - notifyAll(); -} - -void -IceInternal::IncomingConnectionFactory::run() -{ - assert(_acceptor); - - while(true) - { - // - // We must accept new connections outside the thread - // synchronization, because we use blocking accept. - // - TransceiverPtr transceiver; - try - { - transceiver = _acceptor->accept(); - } - catch(const SocketException&) - { - // Ignore socket exceptions. - } - catch(const TimeoutException&) - { - // Ignore timeouts. - } - catch(const LocalException& ex) - { - // Warn about other Ice local exceptions. - if(_warn) - { - Warning out(_instance->initializationData().logger); - out << "connection exception:\n" << ex.toString() << "\n" << _acceptor->toString(); - } - } - - ConnectionPtr connection; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - while(_state == StateHolding) - { - wait(); - } - - if(_state == StateClosed) - { - if(transceiver) - { - try - { - transceiver->close(); - } - catch(const LocalException&) - { - // Here we ignore any exceptions in close(). - } - } - - try - { - _acceptor->close(); - } - catch(const LocalException& ex) - { - _acceptor = 0; - notifyAll(); - ex.ice_throw(); - } - - _acceptor = 0; - notifyAll(); - return; - } - - assert(_state == StateActive); - - // - // Reap connections for which destruction has completed. - // - _connections.erase(remove_if(_connections.begin(), _connections.end(), - Ice::constMemFun(&Connection::isFinished)), - _connections.end()); - - // - // Create a connection object for the connection. - // - if(transceiver) - { - try - { - connection = new Connection(_instance, transceiver, _endpoint, _adapter); - } - catch(const LocalException&) - { - return; - } - - _connections.push_back(connection); - } - } - - // - // In thread per connection mode, the connection's thread will - // take care of connection validation and activation. We don't - // want to block this thread waiting until validation is - // complete because it is the only thread that can accept - // connections with this factory's acceptor. Therefore we - // don't call validate() and activate() from the connection - // factory in thread per connection mode. - // - } -} - -IceInternal::IncomingConnectionFactory::ThreadPerIncomingConnectionFactory::ThreadPerIncomingConnectionFactory( - const IncomingConnectionFactoryPtr& factory) : - _factory(factory) -{ -} - -void -IceInternal::IncomingConnectionFactory::ThreadPerIncomingConnectionFactory::run() -{ - try - { - _factory->run(); - } - catch(const Exception& ex) - { - Error out(_factory->_instance->initializationData().logger); - out << "exception in thread per incoming connection factory:\n" << _factory->toString() << ex.toString(); - } - catch(const std::exception& ex) - { - Error out(_factory->_instance->initializationData().logger); - out << "std::exception in thread per incoming connection factory:\n" << _factory->toString() << ex.what(); - } - catch(...) - { - Error out(_factory->_instance->initializationData().logger); - out << "unknown exception in thread per incoming connection factory:\n" << _factory->toString(); - } - - _factory = 0; // Resolve cyclic dependency. -} diff --git a/cppe/src/IceE/IncomingConnectionFactory.h b/cppe/src/IceE/IncomingConnectionFactory.h deleted file mode 100644 index 74d0e08bec5..00000000000 --- a/cppe/src/IceE/IncomingConnectionFactory.h +++ /dev/null @@ -1,97 +0,0 @@ - -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_INCOMING_CONNECTION_FACTORY_H -#define ICEE_INCOMING_CONNECTION_FACTORY_H - -#include <IceE/IncomingConnectionFactoryF.h> -#include <IceE/EndpointF.h> -#include <IceE/ConnectionF.h> -#include <IceE/ObjectAdapterF.h> -#include <IceE/InstanceF.h> -#include <IceE/AcceptorF.h> -#include <IceE/TransceiverF.h> - -#include <IceE/Mutex.h> -#include <IceE/Monitor.h> -#include <IceE/Shared.h> -#include <IceE/Thread.h> -#include <list> - -namespace IceInternal -{ - -class IncomingConnectionFactory : public IceUtil::Monitor<IceUtil::Mutex>, public IceUtil::Shared -{ -public: - - void activate(); - void hold(); - void destroy(); - - void waitUntilHolding() const; - void waitUntilFinished(); - - EndpointPtr endpoint() const; - std::list<Ice::ConnectionPtr> connections() const; -#ifdef ICEE_HAS_BATCH - void flushBatchRequests(); -#endif - - virtual std::string toString() const; - -private: - - IncomingConnectionFactory(const InstancePtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&); - virtual ~IncomingConnectionFactory(); - friend class ::Ice::ObjectAdapter; - - enum State - { - StateActive, - StateHolding, - StateClosed - }; - - void setState(State); - - void run(); - - class ThreadPerIncomingConnectionFactory : public IceUtil::Thread - { - public: - - ThreadPerIncomingConnectionFactory(const IncomingConnectionFactoryPtr&); - virtual void run(); - - private: - - IncomingConnectionFactoryPtr _factory; - }; - friend class ThreadPerIncomingConnectionFactory; - IceUtil::ThreadPtr _threadPerIncomingConnectionFactory; - - const InstancePtr _instance; - AcceptorPtr _acceptor; - const TransceiverPtr _transceiver; - const EndpointPtr _endpoint; - - const ::Ice::ObjectAdapterPtr _adapter; - - const bool _warn; - - std::list<Ice::ConnectionPtr> _connections; - - State _state; -}; - -} - -#endif diff --git a/cppe/src/IceE/Initialize.cpp b/cppe/src/IceE/Initialize.cpp deleted file mode 100644 index 2cf2242c0f7..00000000000 --- a/cppe/src/IceE/Initialize.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Initialize.h> -#include <IceE/Communicator.h> -#include <IceE/Properties.h> -#include <IceE/LocalException.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -StringSeq -Ice::argsToStringSeq(int argc, char* argv[]) -{ - StringSeq result; - for(int i = 0; i < argc; i++) - { - result.push_back(argv[i]); - } - return result; -} - -void -Ice::stringSeqToArgs(const StringSeq& args, int& argc, char* argv[]) -{ - // - // Shift all elements in argv which are present in args to the - // beginning of argv. - // - int i = 0; - while(i < argc) - { - if(find(args.begin(), args.end(), argv[i]) == args.end()) - { - for(int j = i; j < argc - 1; j++) - { - argv[j] = argv[j + 1]; - } - --argc; - } - else - { - ++i; - } - } - - // - // Make sure that argv[argc] == 0, the ISO C++ standard requires this. - // - if(argv) - { - argv[argc] = 0; - } -} - -PropertiesPtr -Ice::createProperties( -#ifdef ICEE_HAS_WSTRING - const StringConverterPtr& converter -#endif - ) -{ - return new Properties( -#ifdef ICEE_HAS_WSTRING - converter -#endif - ); -} - -PropertiesPtr -Ice::createProperties(StringSeq& args, const PropertiesPtr& defaults -#ifdef ICEE_HAS_WSTRING - , const StringConverterPtr& converter -#endif - ) -{ - return new Properties(args, defaults -#ifdef ICEE_HAS_WSTRING - , converter -#endif - ); -} - -PropertiesPtr -Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults -#ifdef ICEE_HAS_WSTRING - , const StringConverterPtr& converter -#endif - ) -{ - StringSeq args = argsToStringSeq(argc, argv); - PropertiesPtr properties = createProperties(args, defaults -#ifdef ICEE_HAS_WSTRING - , converter -#endif - ); - stringSeqToArgs(args, argc, argv); - return properties; -} - -inline void checkIceVersion(Int version) -{ -#ifndef ICE_IGNORE_VERSION - // - // Major and minor version numbers must match. - // - if(ICEE_INT_VERSION / 100 != version / 100) - { - throw VersionMismatchException(__FILE__, __LINE__); - } - // - // The caller's patch level cannot be greater than library's patch level. (Patch level changes are - // backward-compatible, but not forward-compatible.) - // - if(version % 100 > ICEE_INT_VERSION % 100) - { - throw VersionMismatchException(__FILE__, __LINE__); - } -#endif -} - - -CommunicatorPtr -Ice::initialize(int& argc, char* argv[], const InitializationData& initializationData, Int version) -{ - checkIceVersion(version); - - InitializationData initData = initializationData; - initData.properties = createProperties(argc, argv, initData.properties); - - CommunicatorPtr communicator = new Communicator(initData); - communicator->finishSetup(argc, argv); - return communicator; -} - -CommunicatorPtr -Ice::initialize(StringSeq& args, const InitializationData& initializationData, Int version) -{ - int origArgc = 0; - char** argv = 0; - - CommunicatorPtr communicator; - try - { - // - // Make a dummy argc/argv. - // (We can't use argsToStringSeq() because that requires an already initialized argv.) - // - int argc = args.size(); - origArgc = argc; - argv = new char*[args.size() + 1]; - int i; - for(i = 0; i != argc; ++i) - { - argv[i] = new char[args[i].size() + 1]; -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - strcpy_s(argv[i], args[i].size() + 1, args[i].c_str()); -#else - strcpy(argv[i], args[i].c_str()); -#endif - } - argv[argc] = 0; - - communicator = initialize(argc, argv, initializationData, version); - - args = argsToStringSeq(argc, argv); - - for(i = 0; i < origArgc; ++i) - { - delete[] argv[i]; - } - delete[] argv; - } - catch(...) - { - for(int i = 0; i < origArgc; ++i) - { - delete[] argv[i]; - } - delete[] argv; - throw; - } - return communicator; -} - -CommunicatorPtr -Ice::initialize(const InitializationData& initData, Int version) -{ - // - // We can't simply call the other initialize() because this one does NOT read - // the config file, while the other one always does. - // - checkIceVersion(version); - - CommunicatorPtr communicator = new Communicator(initData); - int argc = 0; - char* argv[] = { 0 }; - communicator->finishSetup(argc, argv); - return communicator; -} - -InstancePtr -IceInternal::getInstance(const CommunicatorPtr& communicator) -{ - return communicator->_instance; -} diff --git a/cppe/src/IceE/Instance.cpp b/cppe/src/IceE/Instance.cpp deleted file mode 100644 index 567813a0e01..00000000000 --- a/cppe/src/IceE/Instance.cpp +++ /dev/null @@ -1,765 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/Instance.h> -#include <IceE/TraceLevels.h> -#include <IceE/DefaultsAndOverrides.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfo.h> -# include <IceE/Router.h> -#endif -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfo.h> -# include <IceE/Locator.h> -#endif -#include <IceE/ReferenceFactory.h> -#include <IceE/ProxyFactory.h> -#include <IceE/OutgoingConnectionFactory.h> -#include <IceE/LocalException.h> -#include <IceE/Properties.h> -#include <IceE/LoggerI.h> -#include <IceE/EndpointFactory.h> -#ifndef ICEE_PURE_CLIENT -# include <IceE/ObjectAdapterFactory.h> -#endif -#include <IceE/StaticMutex.h> -#include <IceE/StringUtil.h> - -#ifdef _WIN32 -# include <winsock2.h> -#else -# include <signal.h> -# include <pwd.h> -# include <sys/types.h> -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER; -static bool oneOffDone = false; -static int instanceCount = 0; -static bool printProcessIdDone = false; - -namespace IceUtil -{ - -extern bool nullHandleAbort; - -} - -IceUtil::Shared* IceInternal::upCast(Instance* p) { return p; } - -bool -IceInternal::Instance::destroyed() const -{ - IceUtil::RecMutex::Lock sync(*this); - return _state == StateDestroyed; -} - -TraceLevelsPtr -IceInternal::Instance::traceLevels() const -{ - // No mutex lock, immutable. - return _traceLevels; -} - -DefaultsAndOverridesPtr -IceInternal::Instance::defaultsAndOverrides() const -{ - // No mutex lock, immutable. - return _defaultsAndOverrides; -} - -#ifdef ICEE_HAS_ROUTER - -RouterManagerPtr -IceInternal::Instance::routerManager() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _routerManager; -} - -#endif - -#ifdef ICEE_HAS_LOCATOR - -LocatorManagerPtr -IceInternal::Instance::locatorManager() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _locatorManager; -} - -#endif - -ReferenceFactoryPtr -IceInternal::Instance::referenceFactory() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _referenceFactory; -} - -ProxyFactoryPtr -IceInternal::Instance::proxyFactory() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _proxyFactory; -} - -OutgoingConnectionFactoryPtr -IceInternal::Instance::outgoingConnectionFactory() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _outgoingConnectionFactory; -} - -#ifndef ICEE_PURE_CLIENT -ObjectAdapterFactoryPtr -IceInternal::Instance::objectAdapterFactory() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _objectAdapterFactory; -} -#endif - -#ifndef ICEE_PURE_BLOCKING_CLIENT -size_t -IceInternal::Instance::threadPerConnectionStackSize() const -{ - // No mutex lock, immutable. - return _threadPerConnectionStackSize; -} -#endif - -EndpointFactoryPtr -IceInternal::Instance::endpointFactory() const -{ - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - return _endpointFactory; -} - -#ifdef ICEE_HAS_BATCH -void -IceInternal::Instance::flushBatchRequests() -{ - - OutgoingConnectionFactoryPtr connectionFactory; -#ifndef ICEE_PURE_CLIENT - ObjectAdapterFactoryPtr adapterFactory; -#endif - - { - IceUtil::RecMutex::Lock sync(*this); - - if(_state == StateDestroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - connectionFactory = _outgoingConnectionFactory; -#ifndef ICEE_PURE_CLIENT - adapterFactory = _objectAdapterFactory; -#endif - } - - connectionFactory->flushBatchRequests(); -#ifndef ICEE_PURE_CLIENT - adapterFactory->flushBatchRequests(); -#endif - -} -#endif - -Identity -IceInternal::Instance::stringToIdentity(const string& s) const -{ - Identity ident; - - // - // Find unescaped separator. - // - string::size_type slash = string::npos, pos = 0; - while((pos = s.find('/', pos)) != string::npos) - { - if(pos == 0 || s[pos - 1] != '\\') - { - if(slash == string::npos) - { - slash = pos; - } - else - { - // - // Extra unescaped slash found. - // - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - pos++; - } - - if(slash == string::npos) - { - if(!IceUtil::unescapeString(s, 0, s.size(), ident.name)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - else - { - if(!IceUtil::unescapeString(s, 0, slash, ident.category)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - if(slash + 1 < s.size()) - { - if(!IceUtil::unescapeString(s, slash + 1, s.size(), ident.name)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - } - -#ifdef ICEE_HAS_WSTRING - if(_initData.stringConverter) - { - string tmpString; - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.name.data()), - reinterpret_cast<const Byte*>(ident.name.data() + ident.name.size()), - tmpString); - ident.name = tmpString; - - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.category.data()), - reinterpret_cast<const Byte*>(ident.category.data() + ident.category.size()), - tmpString); - ident.category = tmpString; - } -#endif - - return ident; -} - -string -IceInternal::Instance::identityToString(const Identity& ident) const -{ - string name = ident.name; - string category = ident.category; -#ifdef ICEE_HAS_WSTRING - if(_initData.stringConverter) - { - UTF8BufferI buffer; - Byte* last = _initData.stringConverter->toUTF8(ident.name.data(), ident.name.data() + ident.name.size(), - buffer); - name = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - - buffer.reset(); - last = _initData.stringConverter->toUTF8(ident.category.data(), ident.category.data() + ident.category.size(), - buffer); - category = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } -#endif - if(category.empty()) - { - return IceUtil::escapeString(name, "/"); - } - else - { - return IceUtil::escapeString(category, "/") + '/' + IceUtil::escapeString(name, "/"); - } -} - -IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const InitializationData& initData) : - _state(StateActive), - _initData(initData), - _messageSizeMax(0) -#ifndef ICEE_PURE_BLOCKING_CLIENT - , _threadPerConnectionStackSize(0) -#endif -{ - try - { - __setNoDelete(true); - - IceUtil::StaticMutex::Lock sync(staticMutex); - instanceCount++; - - if(!oneOffDone) - { - // - // StdOut and StdErr redirection - // - - string stdOutFilename = _initData.properties->getProperty("Ice.StdOut"); - string stdErrFilename = _initData.properties->getProperty("Ice.StdErr"); - - if(stdOutFilename != "") - { - FILE * file; -#ifdef _WIN32_WCE - wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdOutFilename.length()]; - mbstowcs(wtext, stdOutFilename.c_str(), stdOutFilename.length()); - file = _wfreopen(wtext, L"a", stdout); - delete wtext; -#else - file = freopen(stdOutFilename.c_str(), "a", stdout); -#endif - if(file == 0) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - - if(stdErrFilename != "") - { - FILE* file; -#ifdef _WIN32_WCE - wchar_t* wtext = new wchar_t[sizeof(wchar_t) * stdErrFilename.length()]; - mbstowcs(wtext, stdErrFilename.c_str(), stdErrFilename.length()); - file = _wfreopen(wtext, L"a", stderr); - delete wtext; -#else - file = freopen(stdErrFilename.c_str(), "a", stderr); -#endif - if(file == 0) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } - - unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds()); - srand(seed); -#ifndef _WIN32 - srand48(seed); -#endif - - if(_initData.properties->getPropertyAsInt("Ice.NullHandleAbort") > 0) - { - IceUtil::nullHandleAbort = true; - } - -#ifndef _WIN32 - string newUser = _initData.properties->getProperty("Ice.ChangeUser"); - if(!newUser.empty()) - { - struct passwd* pw = getpwnam(newUser.c_str()); - if(!pw) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - if(setgid(pw->pw_gid) == -1) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - - if(setuid(pw->pw_uid) == -1) - { - SyscallException ex(__FILE__, __LINE__); - ex.error = getSystemErrno(); - throw ex; - } - } -#endif - oneOffDone = true; - } - - if(instanceCount == 1) - { - -#ifdef _WIN32 - WORD version = MAKEWORD(1, 1); - WSADATA data; - if(WSAStartup(version, &data) != 0) - { - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } -#endif - -#ifndef _WIN32 - struct sigaction action; - action.sa_handler = SIG_IGN; - sigemptyset(&action.sa_mask); - action.sa_flags = 0; - sigaction(SIGPIPE, &action, 0); -#endif - } - - sync.release(); - - - if(!_initData.logger) - { - _initData.logger = new LoggerI(_initData.properties->getProperty("Ice.ProgramName")); - } - - const_cast<TraceLevelsPtr&>(_traceLevels) = new TraceLevels(_initData.properties); - - const_cast<DefaultsAndOverridesPtr&>(_defaultsAndOverrides) = new DefaultsAndOverrides(_initData.properties); - - { - static const int defaultMessageSizeMax = 1024; - Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax); - if(num < 1) - { - const_cast<size_t&>(_messageSizeMax) = defaultMessageSizeMax * 1024; // Ignore non-sensical values. - } - else if(static_cast<size_t>(num) > (size_t)(0x7fffffff / 1024)) - { - const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(0x7fffffff); - } - else - { - // Property is in kilobytes, _messageSizeMax in bytes. - const_cast<size_t&>(_messageSizeMax) = static_cast<size_t>(num) * 1024; - } - } - -#ifndef ICEE_PURE_BLOCKING_CLIENT - { - Int stackSize = _initData.properties->getPropertyAsInt("Ice.ThreadPerConnection.StackSize"); - if(stackSize < 0) - { - stackSize = 0; - } - const_cast<size_t&>(_threadPerConnectionStackSize) = static_cast<size_t>(stackSize); - } -#endif - -#ifdef ICEE_HAS_ROUTER - _routerManager = new RouterManager; -#endif - -#ifdef ICEE_HAS_LOCATOR - _locatorManager = new LocatorManager; -#endif - - _referenceFactory = new ReferenceFactory(this, communicator); - - _proxyFactory = new ProxyFactory(this); - - _endpointFactory = new EndpointFactory(this); - - _outgoingConnectionFactory = new OutgoingConnectionFactory(this); - -#ifndef ICEE_PURE_CLIENT - _objectAdapterFactory = new ObjectAdapterFactory(this, communicator); -#endif - -#ifdef ICEE_HAS_WSTRING - if(!_initData.wstringConverter) - { - _initData.wstringConverter = new UnicodeWstringConverter(); - } -#endif - - __setNoDelete(false); - } - catch(...) - { - { - IceUtil::StaticMutex::Lock sync(staticMutex); - --instanceCount; - } - destroy(); - __setNoDelete(false); - throw; - } -} - -IceInternal::Instance::~Instance() -{ - assert(_state == StateDestroyed); - assert(!_referenceFactory); - assert(!_proxyFactory); - assert(!_outgoingConnectionFactory); -#ifndef ICEE_PURE_CLIENT - assert(!_objectAdapterFactory); -#endif -#ifdef ICEE_HAS_ROUTER - assert(!_routerManager); -#endif -#ifdef ICEE_HAS_LOCATOR - assert(!_locatorManager); -#endif - assert(!_endpointFactory); - - IceUtil::StaticMutex::Lock sync(staticMutex); - if(--instanceCount == 0) - { -#ifdef _WIN32 - WSACleanup(); -#endif - -#ifndef _WIN32 - struct sigaction action; - action.sa_handler = SIG_DFL; - sigemptyset(&action.sa_mask); - action.sa_flags = 0; - sigaction(SIGPIPE, &action, 0); -#endif - } -} - -void -IceInternal::Instance::finishSetup(int& argc, char* argv[]) -{ - // - // Get default router and locator proxies. Don't move this - // initialization before the plug-in initialization!!! The proxies - // might depend on endpoint factories to be installed by plug-ins. - // -#ifdef ICEE_HAS_ROUTER - if(!_defaultsAndOverrides->defaultRouter.empty()) - { - _referenceFactory->setDefaultRouter( - RouterPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultRouter))); - } -#endif - -#ifdef ICEE_HAS_LOCATOR - if(!_defaultsAndOverrides->defaultLocator.empty()) - { - _referenceFactory->setDefaultLocator( - LocatorPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultLocator))); - } -#endif - -#ifndef _WIN32_WCE - // - // Show process id if requested (but only once). - // - bool printProcessId = false; - if(!printProcessIdDone && _initData.properties->getPropertyAsInt("Ice.PrintProcessId") > 0) - { - // - // Safe double-check locking (no dependent variable!) - // - IceUtil::StaticMutex::Lock sync(staticMutex); - printProcessId = !printProcessIdDone; - - // - // We anticipate: we want to print it once, and we don't care when. - // - printProcessIdDone = true; - } - - if(printProcessId) - { -#ifdef _WIN32 - printf("%d\n", _getpid()); -#else - printf("%d\n", getpid()); -#endif - fflush(stdout); - } -#endif -} - -void -IceInternal::Instance::destroy() -{ - { - IceUtil::RecMutex::Lock sync(*this); - - // - // If the _state is not StateActive then the instance is - // either being destroyed, or has already been destroyed. - // - if(_state != StateActive) - { - return; - } - - // - // We cannot set state to StateDestroyed otherwise instance - // methods called during the destroy process (such as - // outgoingConnectionFactory() from - // ObjectAdapterI::deactivate() will cause an exception. - // - _state = StateDestroyInProgress; - } - -#ifndef ICEE_PURE_CLIENT - if(_objectAdapterFactory) - { - _objectAdapterFactory->shutdown(); - } - - if(_outgoingConnectionFactory) - { - _outgoingConnectionFactory->destroy(); - } - - if(_objectAdapterFactory) - { - _objectAdapterFactory->destroy(); - } - - if(_outgoingConnectionFactory) - { - _outgoingConnectionFactory->waitUntilFinished(); - } -#else - if(_outgoingConnectionFactory) - { - _outgoingConnectionFactory->destroy(); - _outgoingConnectionFactory->waitUntilFinished(); - } -#endif - - { - IceUtil::RecMutex::Lock sync(*this); - -#ifndef ICEE_PURE_CLIENT - _objectAdapterFactory = 0; -#endif - _outgoingConnectionFactory = 0; - - if(_referenceFactory) - { - _referenceFactory->destroy(); - _referenceFactory = 0; - } - - // No destroy function defined. - // _proxyFactory->destroy(); - _proxyFactory = 0; - -#ifdef ICEE_HAS_ROUTER - if(_routerManager) - { - _routerManager->destroy(); - _routerManager = 0; - } -#endif - -#ifdef ICEE_HAS_LOCATOR - if(_locatorManager) - { - _locatorManager->destroy(); - _locatorManager = 0; - } -#endif - - if(_endpointFactory) - { - _endpointFactory->destroy(); - _endpointFactory = 0; - } - - _state = StateDestroyed; - } -} - -#ifdef ICEE_HAS_WSTRING -IceInternal::UTF8BufferI::UTF8BufferI() : - _buffer(0), - _offset(0) -{ -} - -IceInternal::UTF8BufferI::~UTF8BufferI() -{ - free(_buffer); -} - -Byte* -IceInternal::UTF8BufferI::getMoreBytes(size_t howMany, Byte* firstUnused) -{ - if(_buffer == 0) - { - _buffer = (Byte*)malloc(howMany); - } - else - { - assert(firstUnused != 0); - _offset = firstUnused - _buffer; - _buffer = (Byte*)realloc(_buffer, _offset + howMany); - } - - return _buffer + _offset; -} - -Byte* -IceInternal::UTF8BufferI::getBuffer() -{ - return _buffer; -} - -void -IceInternal::UTF8BufferI::reset() -{ - free(_buffer); - _buffer = 0; - _offset = 0; -} -#endif diff --git a/cppe/src/IceE/Instance.h b/cppe/src/IceE/Instance.h deleted file mode 100644 index 5f2a2138803..00000000000 --- a/cppe/src/IceE/Instance.h +++ /dev/null @@ -1,130 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_INSTANCE_H -#define ICEE_INSTANCE_H - -#include <IceE/InstanceF.h> -#include <IceE/CommunicatorF.h> -#include <IceE/PropertiesF.h> -#include <IceE/TraceLevelsF.h> -#include <IceE/DefaultsAndOverridesF.h> -#include <IceE/RouterInfoF.h> -#include <IceE/LocatorInfoF.h> -#include <IceE/ReferenceFactoryF.h> -#include <IceE/ProxyFactoryF.h> -#include <IceE/OutgoingConnectionFactoryF.h> -#include <IceE/EndpointFactoryF.h> -#ifndef ICEE_PURE_CLIENT -# include <IceE/ObjectAdapterFactoryF.h> -#endif -#include <IceE/Shared.h> -#include <IceE/RecMutex.h> -#include <IceE/Initialize.h> -#include <IceE/Identity.h> - -namespace IceInternal -{ - -class Instance : public IceUtil::Shared, public IceUtil::RecMutex -{ -public: - - bool destroyed() const; - const Ice::InitializationData& initializationData() const { return _initData; } - TraceLevelsPtr traceLevels() const; - DefaultsAndOverridesPtr defaultsAndOverrides() const; -#ifdef ICEE_HAS_ROUTER - RouterManagerPtr routerManager() const; -#endif -#ifdef ICEE_HAS_LOCATOR - LocatorManagerPtr locatorManager() const; -#endif - ReferenceFactoryPtr referenceFactory() const; - ProxyFactoryPtr proxyFactory() const; - OutgoingConnectionFactoryPtr outgoingConnectionFactory() const; - EndpointFactoryPtr endpointFactory() const; - size_t messageSizeMax() const { return _messageSizeMax; /* Immutable */ } // Inlined for performance reasons. - Ice::Int connectionIdleTime() const; -#ifdef ICEE_HAS_BATCH - void flushBatchRequests(); -#endif - -#ifndef ICEE_PURE_BLOCKING_CLIENT - size_t threadPerConnectionStackSize() const; -#endif - -#ifndef ICEE_PURE_CLIENT - ObjectAdapterFactoryPtr objectAdapterFactory() const; -#endif - - Ice::Identity stringToIdentity(const std::string&) const; - std::string identityToString(const Ice::Identity&) const; - -private: - - Instance(const Ice::CommunicatorPtr&, const Ice::InitializationData&); - virtual ~Instance(); - - void finishSetup(int&, char*[]); - void destroy(); - friend class Ice::Communicator; - - enum State - { - StateActive, - StateDestroyInProgress, - StateDestroyed - }; - State _state; - Ice::InitializationData _initData; // Immutable, not reset by destroy(). - const TraceLevelsPtr _traceLevels; // Immutable, not reset by destroy(). - const DefaultsAndOverridesPtr _defaultsAndOverrides; // Immutable, not reset by destroy(). - const size_t _messageSizeMax; // Immutable, not reset by destroy(). -#ifndef ICEE_PURE_BLOCKING_CLIENT - const size_t _threadPerConnectionStackSize; -#endif -#ifdef ICEE_HAS_ROUTER - RouterManagerPtr _routerManager; -#endif -#ifdef ICEE_HAS_LOCATOR - LocatorManagerPtr _locatorManager; -#endif - ReferenceFactoryPtr _referenceFactory; - ProxyFactoryPtr _proxyFactory; - OutgoingConnectionFactoryPtr _outgoingConnectionFactory; - EndpointFactoryPtr _endpointFactory; - -#ifndef ICEE_PURE_CLIENT - ObjectAdapterFactoryPtr _objectAdapterFactory; -#endif -}; - -#ifdef ICEE_HAS_WSTRING -class UTF8BufferI : public Ice::UTF8Buffer -{ -public: - - UTF8BufferI(); - ~UTF8BufferI(); - - Ice::Byte* getMoreBytes(size_t howMany, Ice::Byte* firstUnused); - Ice::Byte* getBuffer(); - void reset(); - -private: - - Ice::Byte* _buffer; - size_t _offset; -}; -#endif - -} - -#endif diff --git a/cppe/src/IceE/LocalException.cpp b/cppe/src/IceE/LocalException.cpp deleted file mode 100644 index 2eff703326f..00000000000 --- a/cppe/src/IceE/LocalException.cpp +++ /dev/null @@ -1,2048 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/LocalException.h> -#include <IceE/SafeStdio.h> -#include <IceE/StringUtil.h> -#include <IceE/Network.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -Ice::LocalException::LocalException(const char* file, int line) : - Exception(file, line) -{ -} - -Ice::LocalException::~LocalException() throw() -{ -} - -Ice::AlreadyRegisteredException::AlreadyRegisteredException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::AlreadyRegisteredException::AlreadyRegisteredException(const char* __file, int __line, const ::std::string& __kindOfObject, const ::std::string& __id) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - kindOfObject(__kindOfObject), - id(__id) -{ -} - -Ice::AlreadyRegisteredException::~AlreadyRegisteredException() throw() -{ -} - -static const char* __Ice__AlreadyRegisteredException_name = "Ice::AlreadyRegisteredException"; - -::std::string -Ice::AlreadyRegisteredException::ice_name() const -{ - return __Ice__AlreadyRegisteredException_name; -} - -::Ice::Exception* -Ice::AlreadyRegisteredException::ice_clone() const -{ - return new AlreadyRegisteredException(*this); -} - -void -Ice::AlreadyRegisteredException::ice_throw() const -{ - throw *this; -} - -Ice::NotRegisteredException::NotRegisteredException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::NotRegisteredException::NotRegisteredException(const char* __file, int __line, const ::std::string& __kindOfObject, const ::std::string& __id) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - kindOfObject(__kindOfObject), - id(__id) -{ -} - -Ice::NotRegisteredException::~NotRegisteredException() throw() -{ -} - -static const char* __Ice__NotRegisteredException_name = "Ice::NotRegisteredException"; - -::std::string -Ice::NotRegisteredException::ice_name() const -{ - return __Ice__NotRegisteredException_name; -} - -::Ice::Exception* -Ice::NotRegisteredException::ice_clone() const -{ - return new NotRegisteredException(*this); -} - -void -Ice::NotRegisteredException::ice_throw() const -{ - throw *this; -} - -Ice::TwowayOnlyException::TwowayOnlyException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::TwowayOnlyException::TwowayOnlyException(const char* __file, int __line, const ::std::string& __operation) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - operation(__operation) -{ -} - -Ice::TwowayOnlyException::~TwowayOnlyException() throw() -{ -} - -static const char* __Ice__TwowayOnlyException_name = "Ice::TwowayOnlyException"; - -::std::string -Ice::TwowayOnlyException::ice_name() const -{ - return __Ice__TwowayOnlyException_name; -} - -::Ice::Exception* -Ice::TwowayOnlyException::ice_clone() const -{ - return new TwowayOnlyException(*this); -} - -void -Ice::TwowayOnlyException::ice_throw() const -{ - throw *this; -} - -Ice::CloneNotImplementedException::CloneNotImplementedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::CloneNotImplementedException::~CloneNotImplementedException() throw() -{ -} - -static const char* __Ice__CloneNotImplementedException_name = "Ice::CloneNotImplementedException"; - -::std::string -Ice::CloneNotImplementedException::ice_name() const -{ - return __Ice__CloneNotImplementedException_name; -} - -::Ice::Exception* -Ice::CloneNotImplementedException::ice_clone() const -{ - return new CloneNotImplementedException(*this); -} - -void -Ice::CloneNotImplementedException::ice_throw() const -{ - throw *this; -} - -Ice::UnknownException::UnknownException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::UnknownException::UnknownException(const char* __file, int __line, const ::std::string& __unknown) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - unknown(__unknown) -{ -} - -Ice::UnknownException::~UnknownException() throw() -{ -} - -static const char* __Ice__UnknownException_name = "Ice::UnknownException"; - -::std::string -Ice::UnknownException::ice_name() const -{ - return __Ice__UnknownException_name; -} - -::Ice::Exception* -Ice::UnknownException::ice_clone() const -{ - return new UnknownException(*this); -} - -void -Ice::UnknownException::ice_throw() const -{ - throw *this; -} - -Ice::UnknownLocalException::UnknownLocalException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - UnknownException(__file, __line) -#else - ::Ice::UnknownException(__file, __line) -#endif -{ -} - -Ice::UnknownLocalException::UnknownLocalException(const char* __file, int __line, const ::std::string& __unknown) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - UnknownException(__file, __line, __unknown) -#else - ::Ice::UnknownException(__file, __line, __unknown) -#endif -{ -} - -Ice::UnknownLocalException::~UnknownLocalException() throw() -{ -} - -static const char* __Ice__UnknownLocalException_name = "Ice::UnknownLocalException"; - -::std::string -Ice::UnknownLocalException::ice_name() const -{ - return __Ice__UnknownLocalException_name; -} - -::Ice::Exception* -Ice::UnknownLocalException::ice_clone() const -{ - return new UnknownLocalException(*this); -} - -void -Ice::UnknownLocalException::ice_throw() const -{ - throw *this; -} - -Ice::UnknownUserException::UnknownUserException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - UnknownException(__file, __line) -#else - ::Ice::UnknownException(__file, __line) -#endif -{ -} - -Ice::UnknownUserException::UnknownUserException(const char* __file, int __line, const ::std::string& __unknown) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - UnknownException(__file, __line, __unknown) -#else - ::Ice::UnknownException(__file, __line, __unknown) -#endif -{ -} - -Ice::UnknownUserException::~UnknownUserException() throw() -{ -} - -static const char* __Ice__UnknownUserException_name = "Ice::UnknownUserException"; - -::std::string -Ice::UnknownUserException::ice_name() const -{ - return __Ice__UnknownUserException_name; -} - -::Ice::Exception* -Ice::UnknownUserException::ice_clone() const -{ - return new UnknownUserException(*this); -} - -void -Ice::UnknownUserException::ice_throw() const -{ - throw *this; -} - -Ice::VersionMismatchException::VersionMismatchException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::VersionMismatchException::~VersionMismatchException() throw() -{ -} - -static const char* __Ice__VersionMismatchException_name = "Ice::VersionMismatchException"; - -::std::string -Ice::VersionMismatchException::ice_name() const -{ - return __Ice__VersionMismatchException_name; -} - -::Ice::Exception* -Ice::VersionMismatchException::ice_clone() const -{ - return new VersionMismatchException(*this); -} - -void -Ice::VersionMismatchException::ice_throw() const -{ - throw *this; -} - -Ice::CommunicatorDestroyedException::CommunicatorDestroyedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::CommunicatorDestroyedException::~CommunicatorDestroyedException() throw() -{ -} - -static const char* __Ice__CommunicatorDestroyedException_name = "Ice::CommunicatorDestroyedException"; - -::std::string -Ice::CommunicatorDestroyedException::ice_name() const -{ - return __Ice__CommunicatorDestroyedException_name; -} - -::Ice::Exception* -Ice::CommunicatorDestroyedException::ice_clone() const -{ - return new CommunicatorDestroyedException(*this); -} - -void -Ice::CommunicatorDestroyedException::ice_throw() const -{ - throw *this; -} - -#ifndef ICEE_PURE_CLIENT - -Ice::ObjectAdapterDeactivatedException::ObjectAdapterDeactivatedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::ObjectAdapterDeactivatedException::ObjectAdapterDeactivatedException(const char* __file, int __line, const ::std::string& __name) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - name(__name) -{ -} - -Ice::ObjectAdapterDeactivatedException::~ObjectAdapterDeactivatedException() throw() -{ -} - -static const char* __Ice__ObjectAdapterDeactivatedException_name = "Ice::ObjectAdapterDeactivatedException"; - -::std::string -Ice::ObjectAdapterDeactivatedException::ice_name() const -{ - return __Ice__ObjectAdapterDeactivatedException_name; -} - -::Ice::Exception* -Ice::ObjectAdapterDeactivatedException::ice_clone() const -{ - return new ObjectAdapterDeactivatedException(*this); -} - -void -Ice::ObjectAdapterDeactivatedException::ice_throw() const -{ - throw *this; -} -string -Ice::ObjectAdapterDeactivatedException::toString() const -{ - string out = Exception::toString(); - out += ":\nobject adapter `"; - out += name; - out += "' deactivated"; - return out; -} - -Ice::ObjectAdapterIdInUseException::ObjectAdapterIdInUseException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::ObjectAdapterIdInUseException::ObjectAdapterIdInUseException(const char* __file, int __line, const ::std::string& __id) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - id(__id) -{ -} - -Ice::ObjectAdapterIdInUseException::~ObjectAdapterIdInUseException() throw() -{ -} - -static const char* __Ice__ObjectAdapterIdInUseException_name = "Ice::ObjectAdapterIdInUseException"; - -::std::string -Ice::ObjectAdapterIdInUseException::ice_name() const -{ - return __Ice__ObjectAdapterIdInUseException_name; -} - -::Ice::Exception* -Ice::ObjectAdapterIdInUseException::ice_clone() const -{ - return new ObjectAdapterIdInUseException(*this); -} - -void -Ice::ObjectAdapterIdInUseException::ice_throw() const -{ - throw *this; -} - -string -Ice::ObjectAdapterIdInUseException::toString() const -{ -#ifdef ICEE_HAS_LOCATOR - string out = Exception::toString(); - out += ":\nobject adapter with id `"; - out += id; - out += "' is already in use"; - return out; -#else - return string(""); -#endif -} - -#endif // ICEE_PURE_CLIENT - -Ice::NoEndpointException::NoEndpointException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::NoEndpointException::NoEndpointException(const char* __file, int __line, const ::std::string& __proxy) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - proxy(__proxy) -{ -} - -Ice::NoEndpointException::~NoEndpointException() throw() -{ -} - -static const char* __Ice__NoEndpointException_name = "Ice::NoEndpointException"; - -::std::string -Ice::NoEndpointException::ice_name() const -{ - return __Ice__NoEndpointException_name; -} - -::Ice::Exception* -Ice::NoEndpointException::ice_clone() const -{ - return new NoEndpointException(*this); -} - -void -Ice::NoEndpointException::ice_throw() const -{ - throw *this; -} - -Ice::EndpointParseException::EndpointParseException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::EndpointParseException::EndpointParseException(const char* __file, int __line, const ::std::string& __str) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - str(__str) -{ -} - -Ice::EndpointParseException::~EndpointParseException() throw() -{ -} - -static const char* __Ice__EndpointParseException_name = "Ice::EndpointParseException"; - -::std::string -Ice::EndpointParseException::ice_name() const -{ - return __Ice__EndpointParseException_name; -} - -::Ice::Exception* -Ice::EndpointParseException::ice_clone() const -{ - return new EndpointParseException(*this); -} - -void -Ice::EndpointParseException::ice_throw() const -{ - throw *this; -} - -Ice::IdentityParseException::IdentityParseException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::IdentityParseException::IdentityParseException(const char* __file, int __line, const ::std::string& __str) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - str(__str) -{ -} - -Ice::IdentityParseException::~IdentityParseException() throw() -{ -} - -static const char* __Ice__IdentityParseException_name = "Ice::IdentityParseException"; - -::std::string -Ice::IdentityParseException::ice_name() const -{ - return __Ice__IdentityParseException_name; -} - -::Ice::Exception* -Ice::IdentityParseException::ice_clone() const -{ - return new IdentityParseException(*this); -} - -void -Ice::IdentityParseException::ice_throw() const -{ - throw *this; -} - -Ice::ProxyParseException::ProxyParseException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::ProxyParseException::ProxyParseException(const char* __file, int __line, const ::std::string& __str) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - str(__str) -{ -} - -Ice::ProxyParseException::~ProxyParseException() throw() -{ -} - -static const char* __Ice__ProxyParseException_name = "Ice::ProxyParseException"; - -::std::string -Ice::ProxyParseException::ice_name() const -{ - return __Ice__ProxyParseException_name; -} - -::Ice::Exception* -Ice::ProxyParseException::ice_clone() const -{ - return new ProxyParseException(*this); -} - -void -Ice::ProxyParseException::ice_throw() const -{ - throw *this; -} - -Ice::IllegalIdentityException::IllegalIdentityException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::IllegalIdentityException::IllegalIdentityException(const char* __file, int __line, const ::Ice::Identity& __id) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - id(__id) -{ -} - -Ice::IllegalIdentityException::~IllegalIdentityException() throw() -{ -} - -static const char* __Ice__IllegalIdentityException_name = "Ice::IllegalIdentityException"; - -::std::string -Ice::IllegalIdentityException::ice_name() const -{ - return __Ice__IllegalIdentityException_name; -} - -::Ice::Exception* -Ice::IllegalIdentityException::ice_clone() const -{ - return new IllegalIdentityException(*this); -} - -void -Ice::IllegalIdentityException::ice_throw() const -{ - throw *this; -} - -Ice::RequestFailedException::RequestFailedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::RequestFailedException::RequestFailedException(const char* __file, int __line, const ::Ice::Identity& __id, const ::std::string& __facet, const ::std::string& __operation) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - id(__id), - facet(__facet), - operation(__operation) -{ -} - -Ice::RequestFailedException::~RequestFailedException() throw() -{ -} - -static const char* __Ice__RequestFailedException_name = "Ice::RequestFailedException"; - -::std::string -Ice::RequestFailedException::ice_name() const -{ - return __Ice__RequestFailedException_name; -} - -::Ice::Exception* -Ice::RequestFailedException::ice_clone() const -{ - return new RequestFailedException(*this); -} - -void -Ice::RequestFailedException::ice_throw() const -{ - throw *this; -} - -Ice::ObjectNotExistException::ObjectNotExistException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line) -#else - ::Ice::RequestFailedException(__file, __line) -#endif -{ -} - -Ice::ObjectNotExistException::ObjectNotExistException(const char* __file, int __line, const ::Ice::Identity& __id, const ::std::string& __facet, const ::std::string& __operation) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line, __id, __facet, __operation) -#else - ::Ice::RequestFailedException(__file, __line, __id, __facet, __operation) -#endif -{ -} - -Ice::ObjectNotExistException::~ObjectNotExistException() throw() -{ -} - -static const char* __Ice__ObjectNotExistException_name = "Ice::ObjectNotExistException"; - -::std::string -Ice::ObjectNotExistException::ice_name() const -{ - return __Ice__ObjectNotExistException_name; -} - -::Ice::Exception* -Ice::ObjectNotExistException::ice_clone() const -{ - return new ObjectNotExistException(*this); -} - -void -Ice::ObjectNotExistException::ice_throw() const -{ - throw *this; -} - -Ice::FacetNotExistException::FacetNotExistException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line) -#else - ::Ice::RequestFailedException(__file, __line) -#endif -{ -} - -Ice::FacetNotExistException::FacetNotExistException(const char* __file, int __line, const ::Ice::Identity& __id, const ::std::string& __facet, const ::std::string& __operation) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line, __id, __facet, __operation) -#else - ::Ice::RequestFailedException(__file, __line, __id, __facet, __operation) -#endif -{ -} - -Ice::FacetNotExistException::~FacetNotExistException() throw() -{ -} - -static const char* __Ice__FacetNotExistException_name = "Ice::FacetNotExistException"; - -::std::string -Ice::FacetNotExistException::ice_name() const -{ - return __Ice__FacetNotExistException_name; -} - -::Ice::Exception* -Ice::FacetNotExistException::ice_clone() const -{ - return new FacetNotExistException(*this); -} - -void -Ice::FacetNotExistException::ice_throw() const -{ - throw *this; -} - -Ice::OperationNotExistException::OperationNotExistException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line) -#else - ::Ice::RequestFailedException(__file, __line) -#endif -{ -} - -Ice::OperationNotExistException::OperationNotExistException(const char* __file, int __line, const ::Ice::Identity& __id, const ::std::string& __facet, const ::std::string& __operation) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - RequestFailedException(__file, __line, __id, __facet, __operation) -#else - ::Ice::RequestFailedException(__file, __line, __id, __facet, __operation) -#endif -{ -} - -Ice::OperationNotExistException::~OperationNotExistException() throw() -{ -} - -static const char* __Ice__OperationNotExistException_name = "Ice::OperationNotExistException"; - -::std::string -Ice::OperationNotExistException::ice_name() const -{ - return __Ice__OperationNotExistException_name; -} - -::Ice::Exception* -Ice::OperationNotExistException::ice_clone() const -{ - return new OperationNotExistException(*this); -} - -void -Ice::OperationNotExistException::ice_throw() const -{ - throw *this; -} - -Ice::SyscallException::SyscallException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::SyscallException::SyscallException(const char* __file, int __line, ::Ice::Int __error) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - error(__error) -{ -} - -Ice::SyscallException::~SyscallException() throw() -{ -} - -static const char* __Ice__SyscallException_name = "Ice::SyscallException"; - -::std::string -Ice::SyscallException::ice_name() const -{ - return __Ice__SyscallException_name; -} - -::Ice::Exception* -Ice::SyscallException::ice_clone() const -{ - return new SyscallException(*this); -} - -void -Ice::SyscallException::ice_throw() const -{ - throw *this; -} - -Ice::SocketException::SocketException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SyscallException(__file, __line) -#else - ::Ice::SyscallException(__file, __line) -#endif -{ -} - -Ice::SocketException::SocketException(const char* __file, int __line, ::Ice::Int __error) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SyscallException(__file, __line, __error) -#else - ::Ice::SyscallException(__file, __line, __error) -#endif -{ -} - -Ice::SocketException::~SocketException() throw() -{ -} - -static const char* __Ice__SocketException_name = "Ice::SocketException"; - -::std::string -Ice::SocketException::ice_name() const -{ - return __Ice__SocketException_name; -} - -::Ice::Exception* -Ice::SocketException::ice_clone() const -{ - return new SocketException(*this); -} - -void -Ice::SocketException::ice_throw() const -{ - throw *this; -} - -Ice::FileException::FileException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SyscallException(__file, __line) -#else - ::Ice::SyscallException(__file, __line) -#endif -{ -} - -Ice::FileException::FileException(const char* __file, int __line, ::Ice::Int __error, const ::std::string& __path) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SyscallException(__file, __line, __error), -#else - ::Ice::SyscallException(__file, __line, __error), -#endif - path(__path) -{ -} - -Ice::FileException::~FileException() throw() -{ -} - -static const char* __Ice__FileException_name = "Ice::FileException"; - -::std::string -Ice::FileException::ice_name() const -{ - return __Ice__FileException_name; -} - -::Ice::Exception* -Ice::FileException::ice_clone() const -{ - return new FileException(*this); -} - -void -Ice::FileException::ice_throw() const -{ - throw *this; -} - -Ice::ConnectFailedException::ConnectFailedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SocketException(__file, __line) -#else - ::Ice::SocketException(__file, __line) -#endif -{ -} - -Ice::ConnectFailedException::ConnectFailedException(const char* __file, int __line, ::Ice::Int __error) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SocketException(__file, __line, __error) -#else - ::Ice::SocketException(__file, __line, __error) -#endif -{ -} - -Ice::ConnectFailedException::~ConnectFailedException() throw() -{ -} - -static const char* __Ice__ConnectFailedException_name = "Ice::ConnectFailedException"; - -::std::string -Ice::ConnectFailedException::ice_name() const -{ - return __Ice__ConnectFailedException_name; -} - -::Ice::Exception* -Ice::ConnectFailedException::ice_clone() const -{ - return new ConnectFailedException(*this); -} - -void -Ice::ConnectFailedException::ice_throw() const -{ - throw *this; -} - -Ice::ConnectionRefusedException::ConnectionRefusedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ConnectFailedException(__file, __line) -#else - ::Ice::ConnectFailedException(__file, __line) -#endif -{ -} - -Ice::ConnectionRefusedException::ConnectionRefusedException(const char* __file, int __line, ::Ice::Int __error) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ConnectFailedException(__file, __line, __error) -#else - ::Ice::ConnectFailedException(__file, __line, __error) -#endif -{ -} - -Ice::ConnectionRefusedException::~ConnectionRefusedException() throw() -{ -} - -static const char* __Ice__ConnectionRefusedException_name = "Ice::ConnectionRefusedException"; - -::std::string -Ice::ConnectionRefusedException::ice_name() const -{ - return __Ice__ConnectionRefusedException_name; -} - -::Ice::Exception* -Ice::ConnectionRefusedException::ice_clone() const -{ - return new ConnectionRefusedException(*this); -} - -void -Ice::ConnectionRefusedException::ice_throw() const -{ - throw *this; -} - -Ice::ConnectionLostException::ConnectionLostException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SocketException(__file, __line) -#else - ::Ice::SocketException(__file, __line) -#endif -{ -} - -Ice::ConnectionLostException::ConnectionLostException(const char* __file, int __line, ::Ice::Int __error) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - SocketException(__file, __line, __error) -#else - ::Ice::SocketException(__file, __line, __error) -#endif -{ -} - -Ice::ConnectionLostException::~ConnectionLostException() throw() -{ -} - -static const char* __Ice__ConnectionLostException_name = "Ice::ConnectionLostException"; - -::std::string -Ice::ConnectionLostException::ice_name() const -{ - return __Ice__ConnectionLostException_name; -} - -::Ice::Exception* -Ice::ConnectionLostException::ice_clone() const -{ - return new ConnectionLostException(*this); -} - -void -Ice::ConnectionLostException::ice_throw() const -{ - throw *this; -} - -Ice::DNSException::DNSException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::DNSException::DNSException(const char* __file, int __line, ::Ice::Int __error, const ::std::string& __host) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - error(__error), - host(__host) -{ -} - -Ice::DNSException::~DNSException() throw() -{ -} - -static const char* __Ice__DNSException_name = "Ice::DNSException"; - -::std::string -Ice::DNSException::ice_name() const -{ - return __Ice__DNSException_name; -} - -::Ice::Exception* -Ice::DNSException::ice_clone() const -{ - return new DNSException(*this); -} - -void -Ice::DNSException::ice_throw() const -{ - throw *this; -} - -Ice::TimeoutException::TimeoutException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::TimeoutException::~TimeoutException() throw() -{ -} - -static const char* __Ice__TimeoutException_name = "Ice::TimeoutException"; - -::std::string -Ice::TimeoutException::ice_name() const -{ - return __Ice__TimeoutException_name; -} - -::Ice::Exception* -Ice::TimeoutException::ice_clone() const -{ - return new TimeoutException(*this); -} - -void -Ice::TimeoutException::ice_throw() const -{ - throw *this; -} - -Ice::ConnectTimeoutException::ConnectTimeoutException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - TimeoutException(__file, __line) -#else - ::Ice::TimeoutException(__file, __line) -#endif -{ -} - -Ice::ConnectTimeoutException::~ConnectTimeoutException() throw() -{ -} - -static const char* __Ice__ConnectTimeoutException_name = "Ice::ConnectTimeoutException"; - -::std::string -Ice::ConnectTimeoutException::ice_name() const -{ - return __Ice__ConnectTimeoutException_name; -} - -::Ice::Exception* -Ice::ConnectTimeoutException::ice_clone() const -{ - return new ConnectTimeoutException(*this); -} - -void -Ice::ConnectTimeoutException::ice_throw() const -{ - throw *this; -} - -Ice::CloseTimeoutException::CloseTimeoutException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - TimeoutException(__file, __line) -#else - ::Ice::TimeoutException(__file, __line) -#endif -{ -} - -Ice::CloseTimeoutException::~CloseTimeoutException() throw() -{ -} - -static const char* __Ice__CloseTimeoutException_name = "Ice::CloseTimeoutException"; - -::std::string -Ice::CloseTimeoutException::ice_name() const -{ - return __Ice__CloseTimeoutException_name; -} - -::Ice::Exception* -Ice::CloseTimeoutException::ice_clone() const -{ - return new CloseTimeoutException(*this); -} - -void -Ice::CloseTimeoutException::ice_throw() const -{ - throw *this; -} - -Ice::ProtocolException::ProtocolException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::ProtocolException::ProtocolException(const char* __file, int __line, const ::std::string& __reason) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - reason(__reason) -{ -} - -Ice::ProtocolException::~ProtocolException() throw() -{ -} - -static const char* __Ice__ProtocolException_name = "Ice::ProtocolException"; - -::std::string -Ice::ProtocolException::ice_name() const -{ - return __Ice__ProtocolException_name; -} - -::Ice::Exception* -Ice::ProtocolException::ice_clone() const -{ - return new ProtocolException(*this); -} - -void -Ice::ProtocolException::ice_throw() const -{ - throw *this; -} - -Ice::CloseConnectionException::CloseConnectionException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ProtocolException(__file, __line) -#else - ::Ice::ProtocolException(__file, __line) -#endif -{ -} - -Ice::CloseConnectionException::~CloseConnectionException() throw() -{ -} - -static const char* __Ice__CloseConnectionException_name = "Ice::CloseConnectionException"; - -::std::string -Ice::CloseConnectionException::ice_name() const -{ - return __Ice__CloseConnectionException_name; -} - -::Ice::Exception* -Ice::CloseConnectionException::ice_clone() const -{ - return new CloseConnectionException(*this); -} - -void -Ice::CloseConnectionException::ice_throw() const -{ - throw *this; -} - -Ice::ForcedCloseConnectionException::ForcedCloseConnectionException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ProtocolException(__file, __line) -#else - ::Ice::ProtocolException(__file, __line) -#endif -{ -} - -Ice::ForcedCloseConnectionException::~ForcedCloseConnectionException() throw() -{ -} - -static const char* __Ice__ForcedCloseConnectionException_name = "Ice::ForcedCloseConnectionException"; - -::std::string -Ice::ForcedCloseConnectionException::ice_name() const -{ - return __Ice__ForcedCloseConnectionException_name; -} - -::Ice::Exception* -Ice::ForcedCloseConnectionException::ice_clone() const -{ - return new ForcedCloseConnectionException(*this); -} - -void -Ice::ForcedCloseConnectionException::ice_throw() const -{ - throw *this; -} - -void -Ice::throwBadMagicException(const char* file, int line, const ::Ice::ByteSeq& badMagic) -{ - string out = "unknown magic number: "; - out += Ice::printfToString("0x%2X, 0x%2X, 0x%2X, 0x%2X", badMagic[0], badMagic[1], badMagic[2], badMagic[3]); - throw ProtocolException(__FILE__, __LINE__, out); -} - -void -Ice::throwUnsupportedProtocolException(const char* file, int line, Int badMajor, Int badMinor, Int major, Int minor) -{ - string out = "unsupported protocol version: "; - out += Ice::printfToString("%d.%d", badMajor, badMinor); - out += "\n(can only support protocols compatible with version "; - out += Ice::printfToString("%d.%d", major, minor) + ")"; - throw ProtocolException(__FILE__, __LINE__, out); -} - -void -Ice::throwUnsupportedEncodingException(const char* file, int line, Int badMajor, Int badMinor, Int major, Int minor) -{ - string out = "unsupported encoding version: "; - out += Ice::printfToString("%d.%d", badMajor, badMinor); - out += "\n(can only support protocols compatible with version "; - out += Ice::printfToString("%d.%d", major, minor) + ")"; - throw ProtocolException(__FILE__, __LINE__, out); -} - -Ice::MarshalException::MarshalException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ProtocolException(__file, __line) -#else - ::Ice::ProtocolException(__file, __line) -#endif -{ -} - -Ice::MarshalException::MarshalException(const char* __file, int __line, const ::std::string& __reason) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - ProtocolException(__file, __line, __reason) -#else - ::Ice::ProtocolException(__file, __line, __reason) -#endif -{ -} - -Ice::MarshalException::~MarshalException() throw() -{ -} - -static const char* __Ice__MarshalException_name = "Ice::MarshalException"; - -::std::string -Ice::MarshalException::ice_name() const -{ - return __Ice__MarshalException_name; -} - -::Ice::Exception* -Ice::MarshalException::ice_clone() const -{ - return new MarshalException(*this); -} - -void -Ice::MarshalException::ice_throw() const -{ - throw *this; -} - -Ice::MemoryLimitException::MemoryLimitException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line) -#else - ::Ice::MarshalException(__file, __line) -#endif -{ -} - -Ice::MemoryLimitException::MemoryLimitException(const char* __file, int __line, const ::std::string& __reason) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line, __reason) -#else - ::Ice::MarshalException(__file, __line, __reason) -#endif -{ -} - -Ice::MemoryLimitException::~MemoryLimitException() throw() -{ -} - -static const char* __Ice__MemoryLimitException_name = "Ice::MemoryLimitException"; - -::std::string -Ice::MemoryLimitException::ice_name() const -{ - return __Ice__MemoryLimitException_name; -} - -::Ice::Exception* -Ice::MemoryLimitException::ice_clone() const -{ - return new MemoryLimitException(*this); -} - -void -Ice::MemoryLimitException::ice_throw() const -{ - throw *this; -} - -void -Ice::throwMemoryLimitException(const char* file, int line) -{ - throw MemoryLimitException(file, line); -} - -void -Ice::throwUnmarshalOutOfBoundsException(const char* file, int line) -{ - throw MarshalException(file, line, "out of bounds during unmarshaling"); -} - -void -Ice::throwNegativeSizeException(const char* file, int line) -{ - throw MarshalException(file, line, "negative size for sequence, dictionary, etc."); -} - -Ice::FeatureNotSupportedException::FeatureNotSupportedException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::FeatureNotSupportedException::FeatureNotSupportedException(const char* __file, int __line, const string& __unsupportedFeature) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line), -#else - ::Ice::LocalException(__file, __line), -#endif - unsupportedFeature(__unsupportedFeature) -{ -} - -Ice::FeatureNotSupportedException::~FeatureNotSupportedException() throw() -{ -} - -static const char* __Ice__FeatureNotSupportedException_name = "Ice::FeatureNotSupportedException"; - -::std::string -Ice::FeatureNotSupportedException::ice_name() const -{ - return __Ice__FeatureNotSupportedException_name; -} - -::Ice::Exception* -Ice::FeatureNotSupportedException::ice_clone() const -{ - return new FeatureNotSupportedException(*this); -} - -void -Ice::FeatureNotSupportedException::ice_throw() const -{ - throw *this; -} - -Ice::FixedProxyException::FixedProxyException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - LocalException(__file, __line) -#else - ::Ice::LocalException(__file, __line) -#endif -{ -} - -Ice::FixedProxyException::~FixedProxyException() throw() -{ -} - -static const char* __Ice__FixedProxyException_name = "Ice::FixedProxyException"; - -::std::string -Ice::FixedProxyException::ice_name() const -{ - return __Ice__FixedProxyException_name; -} - -::Ice::Exception* -Ice::FixedProxyException::ice_clone() const -{ - return new FixedProxyException(*this); -} - -void -Ice::FixedProxyException::ice_throw() const -{ - throw *this; -} - -#ifdef ICEE_HAS_WSTRING -Ice::StringConversionException::StringConversionException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line) -#else - ::Ice::MarshalException(__file, __line) -#endif -{ -} - -Ice::StringConversionException::StringConversionException(const char* __file, int __line, const ::std::string& __reason) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line, __reason) -#else - ::Ice::MarshalException(__file, __line, __reason) -#endif -{ -} - -Ice::StringConversionException::~StringConversionException() throw() -{ -} - -static const char* __Ice__StringConversionException_name = "Ice::StringConversionException"; - -::std::string -Ice::StringConversionException::ice_name() const -{ - return __Ice__StringConversionException_name; -} - -::Ice::Exception* -Ice::StringConversionException::ice_clone() const -{ - return new StringConversionException(*this); -} - -void -Ice::StringConversionException::ice_throw() const -{ - throw *this; -} -#endif - -string -Ice::UnknownException::toString() const -{ - string out = Exception::toString(); - out += ":\nunknown exception"; - if(!unknown.empty()) - { - out += ":\n"; - out += unknown; - } - return out; -} - -string -Ice::UnknownLocalException::toString() const -{ - string out = Exception::toString(); - out += ":\nunknown local exception"; - if(!unknown.empty()) - { - out += ":\n"; - out += unknown; - } - return out; -} - -string -Ice::UnknownUserException::toString() const -{ - string out = Exception::toString(); - out += ":\nunknown user exception"; - if(!unknown.empty()) - { - out += ":\n"; - out += unknown; - } - return out; -} - -string -Ice::VersionMismatchException::toString() const -{ - string out = Exception::toString(); - out += ":\nIce library version mismatch"; - return out; -} - -string -Ice::CommunicatorDestroyedException::toString() const -{ - string out = Exception::toString(); - out += ":\ncommunicator object destroyed"; - return out; -} - - -#ifdef never -#endif - -string -Ice::NoEndpointException::toString() const -{ - string out = Exception::toString(); - out += ":\nno suitable endpoint available for proxy `"; - out += proxy; - out += "'"; - return out; -} - -string -Ice::EndpointParseException::toString() const -{ - string out = Exception::toString(); - out += ":\nerror while parsing endpoint `"; - out += str; - out += "'"; - return out; -} - -string -Ice::IdentityParseException::toString() const -{ - string out = Exception::toString(); - out += ":\nerror while parsing identity `"; - out += str; - out += "'"; - return out; -} - -string -Ice::ProxyParseException::toString() const -{ - string out = Exception::toString(); - out += ":\nerror while parsing proxy `"; - out += str; - out += "'"; - return out; -} - -string -Ice::IllegalIdentityException::toString() const -{ - string out = Exception::toString(); - out += ":\nillegal identity: `"; - if(id.category.empty()) - { - out += IceUtil::escapeString(id.name, "/"); - } - else - { - out += IceUtil::escapeString(id.category, "/") + '/' + IceUtil::escapeString(id.name, "/"); - } - out += "'"; - return out; -} - -static void -printFailedRequestData(string& out, const RequestFailedException& ex) -{ - out += "\nidentity: "; - if(ex.id.category.empty()) - { - out += IceUtil::escapeString(ex.id.name, "/"); - } - else - { - out += IceUtil::escapeString(ex.id.category, "/") + '/' + IceUtil::escapeString(ex.id.name, "/"); - } - out += "\nfacet: "; - out += ex.facet; - out += "\noperation: "; - out += ex.operation; -} - -string -Ice::RequestFailedException::toString() const -{ - string out = Exception::toString(); - out += ":\nrequest failed"; - printFailedRequestData(out, *this); - return out; -} - -string -Ice::ObjectNotExistException::toString() const -{ - string out = Exception::toString(); - out += ":\nobject does not exist"; - printFailedRequestData(out, *this); - return out; -} - -string -Ice::FacetNotExistException::toString() const -{ - string out = Exception::toString(); - out += ":\nfacet does not exist"; - printFailedRequestData(out, *this); - return out; -} - -string -Ice::OperationNotExistException::toString() const -{ - string out = Exception::toString(); - out += ":\noperation does not exist"; - printFailedRequestData(out, *this); - return out; -} - -string -Ice::SyscallException::toString() const -{ - string out = Exception::toString(); - if(error != 0) - { - out += ":\nsyscall exception: "; - out += errorToString(error); - } - return out; -} - -string -Ice::SocketException::toString() const -{ - string out = Exception::toString(); - out += ":\nsocket exception: "; - out += errorToString(error); - return out; -} - -string -Ice::FileException::toString() const -{ - - string out = Exception::toString(); - - out += ":\nfile exception: "; - - out += errorToString(error); - - if(!path.empty()) - - { - - out += "\npath: "; - - out += path; - - } - - return out; - -} - -string -Ice::ConnectFailedException::toString() const -{ - string out = Exception::toString(); - out += ":\nconnect failed: "; - out += errorToString(error); - return out; -} - -string -Ice::ConnectionRefusedException::toString() const -{ - string out = Exception::toString(); - out += ":\nconnection refused: "; - out += errorToString(error); - return out; -} - -string -Ice::ConnectionLostException::toString() const -{ - string out = Exception::toString(); - out += ":\nconnection lost: "; - if(error == 0) - { - out += "recv() returned zero"; - } - else - { - out += errorToString(error); - } - return out; -} - -string -Ice::DNSException::toString() const -{ - string out = Exception::toString(); - out += ":\nDNS error: "; - out += errorToStringDNS(error); - out += "\nhost: "; - out += host; - return out; -} - -string -Ice::TimeoutException::toString() const -{ - string out = Exception::toString(); - out += ":\ntimeout while sending or receiving data"; - return out; -} - -string -Ice::ConnectTimeoutException::toString() const -{ - string out = Exception::toString(); - out += ":\ntimeout while establishing a connection"; - return out; -} - -string -Ice::CloseTimeoutException::toString() const -{ - string out = Exception::toString(); - out += ":\ntimeout while closing a connection"; - return out; -} - -string -Ice::ProtocolException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: "; - if(!reason.empty()) - { - out += reason; - } - else - { - out += "unknown protocol exception"; - } - return out; -} - -string -Ice::CloseConnectionException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: connection closed"; - return out; -} - -string -Ice::ForcedCloseConnectionException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: connection forcefully closed"; - return out; -} - -string -Ice::FeatureNotSupportedException::toString() const -{ - string out = Exception::toString(); - out += ":\nfeature not supported"; - if(!unsupportedFeature.empty()) - { - out += ": "; - out += unsupportedFeature; - } - return out; -} - -string -Ice::MarshalException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: error during marshaling or unmarshaling"; - if(!reason.empty()) - { - out += ":\n"; - out += reason; - } - return out; -} - -string -Ice::MemoryLimitException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: memory limit exceeded"; - return out; -} - -string -Ice::AlreadyRegisteredException::toString() const -{ - string out = Exception::toString(); - out += ":\n"; - out += kindOfObject; - out += " with id `"; - out += id; - out += "' is already registered"; - return out; -} - -string -Ice::NotRegisteredException::toString() const -{ - string out = Exception::toString(); - out += ":\n no "; - out += kindOfObject; - out += " with id `"; - out += id; - out += "' is registered"; - return out; -} - -string -Ice::TwowayOnlyException::toString() const -{ - string out = Exception::toString(); - out += ":\n operation `"; - out += operation; - out += "' can only be invoked as a twoway request"; - return out; -} - -string -Ice::CloneNotImplementedException::toString() const -{ - string out = Exception::toString(); - out += ":\n ice_clone() must be implemented in classes derived from abstract base classes"; - return out; -} - -string -Ice::FixedProxyException::toString() const -{ - string out = Exception::toString(); - out += ":\nfixed proxy exception"; - return out; -} - -#ifdef ICEE_HAS_WSTRING -string -Ice::StringConversionException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: string conversion failed"; - return out; -} -#endif diff --git a/cppe/src/IceE/LocatorInfo.cpp b/cppe/src/IceE/LocatorInfo.cpp deleted file mode 100644 index a7e53e09701..00000000000 --- a/cppe/src/IceE/LocatorInfo.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Config.h> - -#ifdef ICEE_HAS_LOCATOR - -#include <IceE/LocatorInfo.h> -#include <IceE/Locator.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/TraceLevels.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Endpoint.h> -#include <IceE/Reference.h> -#include <IceE/Functional.h> -#include <iterator> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(LocatorManager* p) { return p; } -IceUtil::Shared* IceInternal::upCast(LocatorInfo* p) { return p; } -IceUtil::Shared* IceInternal::upCast(LocatorTable* p) { return p; } - -IceInternal::LocatorManager::LocatorManager() : - _tableHint(_table.end()) -{ -} - -void -IceInternal::LocatorManager::destroy() -{ - IceUtil::Mutex::Lock sync(*this); - - for_each(_table.begin(), _table.end(), Ice::secondVoidMemFun<const LocatorPrx, LocatorInfo>(&LocatorInfo::destroy)); - - _table.clear(); - _tableHint = _table.end(); - - _locatorTables.clear(); -} - -LocatorInfoPtr -IceInternal::LocatorManager::get(const LocatorPrx& loc) -{ - if(!loc) - { - return 0; - } - - LocatorPrx locator = LocatorPrx::uncheckedCast(loc->ice_locator(0)); // The locator can't be located. - - // - // TODO: reap unused locator info objects? - // - - IceUtil::Mutex::Lock sync(*this); - - map<LocatorPrx, LocatorInfoPtr>::iterator p = _table.end(); - - if(_tableHint != _table.end()) - { - if(_tableHint->first == locator) - { - p = _tableHint; - } - } - - if(p == _table.end()) - { - p = _table.find(locator); - } - - if(p == _table.end()) - { - // - // Rely on locator identity for the adapter table. We want to - // have only one table per locator (not one per locator - // proxy). - // - map<Identity, LocatorTablePtr>::iterator t = _locatorTables.find(locator->ice_getIdentity()); - if(t == _locatorTables.end()) - { - t = _locatorTables.insert(_locatorTables.begin(), - pair<const Identity, LocatorTablePtr>(locator->ice_getIdentity(), - new LocatorTable())); - } - - _tableHint = _table.insert(_tableHint, - pair<const LocatorPrx, LocatorInfoPtr>(locator, new LocatorInfo(locator, t->second))); - } - else - { - _tableHint = p; - } - - return _tableHint->second; -} - -IceInternal::LocatorTable::LocatorTable() -{ -} - -void -IceInternal::LocatorTable::clear() -{ - IceUtil::Mutex::Lock sync(*this); - - _adapterEndpointsMap.clear(); - _objectMap.clear(); -} - -bool -IceInternal::LocatorTable::getAdapterEndpoints(const string& adapter, vector<EndpointPtr>& endpoints) const -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, vector<EndpointPtr> >::const_iterator p = _adapterEndpointsMap.find(adapter); - - if(p != _adapterEndpointsMap.end()) - { - endpoints = p->second; - return true; - } - else - { - return false; - } -} - -void -IceInternal::LocatorTable::addAdapterEndpoints(const string& adapter, const vector<EndpointPtr>& endpoints) -{ - IceUtil::Mutex::Lock sync(*this); - - _adapterEndpointsMap.insert(make_pair(adapter, endpoints)); -} - -vector<EndpointPtr> -IceInternal::LocatorTable::removeAdapterEndpoints(const string& adapter) -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, vector<EndpointPtr> >::iterator p = _adapterEndpointsMap.find(adapter); - if(p == _adapterEndpointsMap.end()) - { - return vector<EndpointPtr>(); - } - - vector<EndpointPtr> endpoints = p->second; - - _adapterEndpointsMap.erase(p); - - return endpoints; -} - -bool -IceInternal::LocatorTable::getProxy(const Identity& id, ObjectPrx& proxy) const -{ - IceUtil::Mutex::Lock sync(*this); - - map<Identity, ObjectPrx>::const_iterator p = _objectMap.find(id); - - if(p != _objectMap.end()) - { - proxy = p->second; - return true; - } - else - { - return false; - } -} - -void -IceInternal::LocatorTable::addProxy(const Identity& id, const ObjectPrx& proxy) -{ - IceUtil::Mutex::Lock sync(*this); - _objectMap.insert(make_pair(id, proxy)); -} - -ObjectPrx -IceInternal::LocatorTable::removeProxy(const Identity& id) -{ - IceUtil::Mutex::Lock sync(*this); - - map<Identity, ObjectPrx>::iterator p = _objectMap.find(id); - if(p == _objectMap.end()) - { - return 0; - } - - ObjectPrx proxy = p->second; - _objectMap.erase(p); - return proxy; -} - -IceInternal::LocatorInfo::LocatorInfo(const LocatorPrx& locator, const LocatorTablePtr& table) : - _locator(locator), - _table(table) -{ - assert(_locator); - assert(_table); -} - -void -IceInternal::LocatorInfo::destroy() -{ - IceUtil::Mutex::Lock sync(*this); - - _locatorRegistry = 0; - _table->clear(); -} - -bool -IceInternal::LocatorInfo::operator==(const LocatorInfo& rhs) const -{ - return _locator == rhs._locator; -} - -bool -IceInternal::LocatorInfo::operator!=(const LocatorInfo& rhs) const -{ - return _locator != rhs._locator; -} - -bool -IceInternal::LocatorInfo::operator<(const LocatorInfo& rhs) const -{ - return _locator < rhs._locator; -} - -LocatorPrx -IceInternal::LocatorInfo::getLocator() const -{ - // - // No mutex lock necessary, _locator is immutable. - // - return _locator; -} - -LocatorRegistryPrx -IceInternal::LocatorInfo::getLocatorRegistry() -{ - IceUtil::Mutex::Lock sync(*this); - - if(!_locatorRegistry) // Lazy initialization. - { - _locatorRegistry = _locator->getRegistry(); - - // - // The locator registry can't be located. - // - _locatorRegistry = LocatorRegistryPrx::uncheckedCast(_locatorRegistry->ice_locator(0)); - } - - return _locatorRegistry; -} - -vector<EndpointPtr> -IceInternal::LocatorInfo::getEndpoints(const IndirectReferencePtr& ref, bool& cached) -{ - vector<EndpointPtr> endpoints; - ObjectPrx object; - cached = true; - - try - { - if(!ref->getAdapterId().empty()) - { - if(!_table->getAdapterEndpoints(ref->getAdapterId(), endpoints)) - { - cached = false; - - if(ref->getInstance()->traceLevels()->location >= 1) - { - Trace out(ref->getInstance()->initializationData().logger, - ref->getInstance()->traceLevels()->locationCat); - out << "searching for adapter by id" << "\n"; - out << "adapter = " << ref->getAdapterId(); - } - - object = _locator->findAdapterById(ref->getAdapterId()); - if(object) - { - endpoints = object->__reference()->getEndpoints(); - _table->addAdapterEndpoints(ref->getAdapterId(), endpoints); - } - } - } - else - { - bool objectCached = true; - if(!_table->getProxy(ref->getIdentity(), object)) - { - - if(ref->getInstance()->traceLevels()->location >= 1) - { - Trace out(ref->getInstance()->initializationData().logger, - ref->getInstance()->traceLevels()->locationCat); - out << "searching for object by id" << "\n"; - out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()); - } - - objectCached = false; - object = _locator->findObjectById(ref->getIdentity()); - } - - bool endpointsCached = true; - if(object) - { - DirectReferencePtr odr = DirectReferencePtr::dynamicCast(object->__reference()); - if(odr) - { - endpointsCached = false; - endpoints = odr->getEndpoints(); - } - else - { - IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference()); - assert(oir); - if(!oir->getAdapterId().empty()) - { - endpoints = getEndpoints(oir, endpointsCached); - } - } - } - - if(!objectCached && !endpoints.empty()) - { - _table->addProxy(ref->getIdentity(), object); - } - - cached = objectCached || endpointsCached; - } - } - catch(const AdapterNotFoundException&) - { - if(ref->getInstance()->traceLevels()->location >= 1) - { - Trace out(ref->getInstance()->initializationData().logger, - ref->getInstance()->traceLevels()->locationCat); - out << "adapter not found" << "\n"; - out << "adapter = " << ref->getAdapterId(); - } - - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "object adapter"; - ex.id = ref->getAdapterId(); - throw ex; - } - catch(const ObjectNotFoundException&) - { - if(ref->getInstance()->traceLevels()->location >= 1) - { - Trace out(ref->getInstance()->initializationData().logger, - ref->getInstance()->traceLevels()->locationCat); - out << "object not found" << "\n"; - out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()); - } - - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "object"; - ex.id = ref->getInstance()->identityToString(ref->getIdentity()); - throw ex; - } - catch(const NotRegisteredException&) - { - throw; - } - catch(const LocalException& ex) - { - if(ref->getInstance()->traceLevels()->location >= 1) - { - Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat); - out << "couldn't contact the locator to retrieve adapter endpoints\n"; - if(!ref) - { - out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n"; - } - else - { - out << "adapter = " << ref->getAdapterId() << "\n"; - } - out << "reason = " << ex.toString(); - } - throw; - } - - if(ref->getInstance()->traceLevels()->location >= 1) - { - if(!endpoints.empty()) - { - if(cached) - { - trace("found endpoints in locator table", ref, endpoints); - } - else - { - trace("retrieved endpoints from locator, adding to locator table", ref, endpoints); - } - } - else - { - Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat); - out << "no endpoints configured for "; - if(ref->getAdapterId().empty()) - { - out << "object\n"; - out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()); - } - else - { - out << "adapter\n"; - out << "adapter = " << ref->getAdapterId(); - } - } - } - - return endpoints; -} - -void -IceInternal::LocatorInfo::clearObjectCache(const IndirectReferencePtr& ref) -{ - if(ref->getAdapterId().empty()) - { - ObjectPrx object = _table->removeProxy(ref->getIdentity()); - if(object) - { - IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference()); - if(oir) - { - if(!oir->getAdapterId().empty()) - { - clearCache(oir); - } - } - else - { - if(ref->getInstance()->traceLevels()->location >= 2) - { - trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints()); - } - } - } - } -} - -void -IceInternal::LocatorInfo::clearCache(const IndirectReferencePtr& ref) -{ - if(!ref->getAdapterId().empty()) - { - vector<EndpointPtr> endpoints = _table->removeAdapterEndpoints(ref->getAdapterId()); - - if(!endpoints.empty() && ref->getInstance()->traceLevels()->location >= 2) - { - trace("removed endpoints from locator table", ref, endpoints); - } - } - else - { - ObjectPrx object = _table->removeProxy(ref->getIdentity()); - if(object) - { - IndirectReferencePtr oir = IndirectReferencePtr::dynamicCast(object->__reference()); - if(oir) - { - if(!oir->getAdapterId().empty()) - { - clearCache(oir); - } - } - else - { - if(ref->getInstance()->traceLevels()->location >= 2) - { - trace("removed endpoints from locator table", ref, object->__reference()->getEndpoints()); - } - } - } - } -} - -void -IceInternal::LocatorInfo::trace(const string& msg, - const IndirectReferencePtr& ref, - const vector<EndpointPtr>& endpoints) -{ - Trace out(ref->getInstance()->initializationData().logger, ref->getInstance()->traceLevels()->locationCat); - out << msg << "\n"; - if(!ref->getAdapterId().empty()) - { - out << "adapter = " << ref->getAdapterId() << "\n"; - } - else - { - out << "object = " << ref->getInstance()->identityToString(ref->getIdentity()) << "\n"; - } - - const char* sep = endpoints.size() > 1 ? ":" : ""; - out << "endpoints = "; - for(unsigned int i = 0; i < endpoints.size(); ++i) - { - out << endpoints[i]->toString() << sep; - } -} - -#endif diff --git a/cppe/src/IceE/LocatorInfo.h b/cppe/src/IceE/LocatorInfo.h deleted file mode 100644 index 680687b6ac2..00000000000 --- a/cppe/src/IceE/LocatorInfo.h +++ /dev/null @@ -1,104 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_LOCATOR_INFO_H -#define ICEE_LOCATOR_INFO_H - -#include <IceE/Config.h> - -#ifdef ICEE_HAS_LOCATOR - -#include <IceE/LocatorInfoF.h> -#include <IceE/LocatorF.h> -#include <IceE/ProxyF.h> -#include <IceE/EndpointF.h> - -#include <IceE/Shared.h> -#include <IceE/Mutex.h> - -namespace IceInternal -{ - -class LocatorManager : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - LocatorManager(); - - void destroy(); - - // - // Returns locator info for a given locator. Automatically creates - // the locator info if it doesn't exist yet. - // - LocatorInfoPtr get(const Ice::LocatorPrx&); - -private: - - std::map<Ice::LocatorPrx, LocatorInfoPtr> _table; - std::map<Ice::LocatorPrx, LocatorInfoPtr>::iterator _tableHint; - - std::map<Ice::Identity, LocatorTablePtr> _locatorTables; -}; - -class LocatorTable : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - LocatorTable(); - - void clear(); - - bool getAdapterEndpoints(const std::string&, ::std::vector<EndpointPtr>&) const; - void addAdapterEndpoints(const std::string&, const ::std::vector<EndpointPtr>&); - ::std::vector<EndpointPtr> removeAdapterEndpoints(const std::string&); - - bool getProxy(const Ice::Identity&, Ice::ObjectPrx&) const; - void addProxy(const Ice::Identity&, const Ice::ObjectPrx&); - Ice::ObjectPrx removeProxy(const Ice::Identity&); - -private: - - std::map<std::string, std::vector<EndpointPtr> > _adapterEndpointsMap; - std::map<Ice::Identity, Ice::ObjectPrx > _objectMap; -}; - -class LocatorInfo : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - LocatorInfo(const Ice::LocatorPrx&, const LocatorTablePtr&); - - void destroy(); - - bool operator==(const LocatorInfo&) const; - bool operator!=(const LocatorInfo&) const; - bool operator<(const LocatorInfo&) const; - - Ice::LocatorPrx getLocator() const; - Ice::LocatorRegistryPrx getLocatorRegistry(); - - std::vector<EndpointPtr> getEndpoints(const IndirectReferencePtr&, bool&); - void clearCache(const IndirectReferencePtr&); - void clearObjectCache(const IndirectReferencePtr&); - -private: - - void trace(const std::string&, const IndirectReferencePtr&, const std::vector<EndpointPtr>&); - - const Ice::LocatorPrx _locator; - Ice::LocatorRegistryPrx _locatorRegistry; - const LocatorTablePtr _table; -}; - -} - -#endif - -#endif diff --git a/cppe/src/IceE/Logger.cpp b/cppe/src/IceE/Logger.cpp deleted file mode 100644 index f1de430d70c..00000000000 --- a/cppe/src/IceE/Logger.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Logger.h> - -IceUtil::Shared* IceInternal::upCast(::Ice::Logger* p) { return p; } diff --git a/cppe/src/IceE/LoggerI.cpp b/cppe/src/IceE/LoggerI.cpp deleted file mode 100644 index c9db36ea8c8..00000000000 --- a/cppe/src/IceE/LoggerI.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/LoggerI.h> -#include <IceE/StaticMutex.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -static IceUtil::StaticMutex globalMutex = ICE_STATIC_MUTEX_INITIALIZER; - -Ice::LoggerI::LoggerI(const string& prefix) -{ - if(!prefix.empty()) - { - _prefix = prefix + ": "; - } -} - -void -Ice::LoggerI::print(const string& message) -{ - IceUtil::StaticMutex::Lock sync(globalMutex); - fprintf(stderr, "%s\n", message.c_str()); -} - -void -Ice::LoggerI::trace(const string& category, const string& message) -{ - string s = "[ "; - s += _prefix; - if(!category.empty()) - { - s += category + ": "; - } - s += message + " ]"; - - string::size_type idx = 0; - while((idx = s.find("\n", idx)) != string::npos) - { - s.insert(idx + 1, " "); - ++idx; - } - - IceUtil::StaticMutex::Lock sync(globalMutex); - fprintf(stderr, "%s\n", s.c_str()); -} - -void -Ice::LoggerI::warning(const string& message) -{ - IceUtil::StaticMutex::Lock sync(globalMutex); - fprintf(stderr, "%swarning: %s\n", _prefix.c_str(), message.c_str()); -} - -void -Ice::LoggerI::error(const string& message) -{ - IceUtil::StaticMutex::Lock sync(globalMutex); - fprintf(stderr, "%serror: %s\n", _prefix.c_str(), message.c_str()); -} diff --git a/cppe/src/IceE/LoggerI.h b/cppe/src/IceE/LoggerI.h deleted file mode 100644 index 77a7adc5aa4..00000000000 --- a/cppe/src/IceE/LoggerI.h +++ /dev/null @@ -1,37 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_LOGGER_I_H -#define ICEE_LOGGER_I_H - -#include <IceE/Logger.h> -#include <IceE/Mutex.h> - -namespace Ice -{ - -class LoggerI : public Logger -{ -public: - - LoggerI(const std::string&); - - virtual void print(const std::string&); - virtual void trace(const std::string&, const std::string&); - virtual void warning(const std::string&); - virtual void error(const std::string&); - -private: - - std::string _prefix; -}; - -} - -#endif diff --git a/cppe/src/IceE/LoggerUtil.cpp b/cppe/src/IceE/LoggerUtil.cpp deleted file mode 100644 index b0db6828da5..00000000000 --- a/cppe/src/IceE/LoggerUtil.cpp +++ /dev/null @@ -1,120 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/LoggerUtil.h> -#include <IceE/Logger.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -Ice::Print::Print(const LoggerPtr& logger) : - _logger(logger) -{ -} - -Ice::Print::~Print() -{ - flush(); -} - -void -Ice::Print::flush() -{ - if(!_str.empty()) - { - _logger->print(_str); - } - _str = "";; -} - -string& -Ice::Print::__str() -{ - return _str; -} - -Ice::Warning::Warning(const LoggerPtr& logger) : - _logger(logger) -{ -} - -Ice::Warning::~Warning() -{ - flush(); -} - -void -Ice::Warning::flush() -{ - if(!_str.empty()) - { - _logger->warning(_str); - } - _str = ""; -} - -string& -Ice::Warning::__str() -{ - return _str; -} - -Ice::Error::Error(const LoggerPtr& logger) : - _logger(logger) -{ -} - -Ice::Error::~Error() -{ - flush(); -} - -void -Ice::Error::flush() -{ - if(!_str.empty()) - { - _logger->error(_str); - } - _str = ""; -} - -string& -Ice::Error::__str() -{ - return _str; -} - -Ice::Trace::Trace(const LoggerPtr& logger, const string& category) : - _logger(logger), - _category(category) -{ -} - -Ice::Trace::~Trace() -{ - flush(); -} - -void -Ice::Trace::flush() -{ - if(!_str.empty()) - { - _logger->trace(_category, _str); - } - _str = ""; -} - -string& -Ice::Trace::__str() -{ - return _str; -} diff --git a/cppe/src/IceE/Makefile b/cppe/src/IceE/Makefile deleted file mode 100644 index 8169f6809f3..00000000000 --- a/cppe/src/IceE/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -# -# This copy of Ice-E is licensed to you under the terms described in the -# ICEE_LICENSE file included in this distribution. -# -# ********************************************************************** - -top_srcdir = ../.. - -LIBFILENAME = $(call mklibfilename,IceE,$(VERSION)) -SONAME = $(call mksoname,IceE,$(SOVERSION)) -LIBNAME = $(call mklibname,IceE) - -TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) - -TRANSPORT_DIR = $(top_srcdir)/src/TcpTransport - -%.o: $(TRANSPORT_DIR)/%.cpp - $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< - -TRANSPORT_OBJS = Acceptor.o \ - Connector.o \ - EndpointFactory.o \ - TcpEndpoint.o \ - Transceiver.o - -LOCAL_OBJS = BasicStream.o \ - Buffer.o \ - BuiltinSequences.o \ - Communicator.o \ - Cond.o \ - Connection.o \ - ConvertUTF.o \ - Current.o \ - DefaultsAndOverrides.o \ - Endpoint.o \ - ExceptionBase.o \ - FactoryTable.o \ - FactoryTableDef.o \ - Identity.o \ - Incoming.o \ - IncomingConnectionFactory.o \ - Initialize.o \ - Instance.o \ - LocalException.o \ - Locator.o \ - LocatorInfo.o \ - Logger.o \ - LoggerI.o \ - LoggerUtil.o \ - Network.o \ - Object.o \ - ObjectAdapter.o \ - ObjectAdapterFactory.o \ - OperationMode.o \ - Outgoing.o \ - OutgoingConnectionFactory.o \ - Properties.o \ - Protocol.o \ - Proxy.o \ - ProxyFactory.o \ - RecMutex.o \ - Reference.o \ - ReferenceFactory.o \ - Router.o \ - RouterInfo.o \ - SafeStdio.o \ - ServantManager.o \ - Shared.o \ - StaticMutex.o \ - StringConverter.o \ - StringUtil.o \ - Thread.o \ - ThreadException.o \ - Time.o \ - TraceLevels.o \ - TraceUtil.o \ - UnknownEndpoint.o \ - Unicode.o \ - UUID.o - -OBJS = $(LOCAL_OBJS) $(TRANSPORT_OBJS) - -SRCS = $(LOCAL_OBJS:.o=.cpp) \ - $(patsubst %.o,$(TRANSPORT_DIR)/%.cpp,$(TRANSPORT_OBJS)) - -SLICE_SRCS = $(SDIR)/BuiltinSequences.ice \ - $(SDIR)/Identity.ice \ - $(SDIR)/LocatorF.ice \ - $(SDIR)/Locator.ice \ - $(SDIR)/RouterF.ice \ - $(SDIR)/Router.ice - -HDIR = $(includedir)/IceE -SDIR = $(slicedir)/IceE - -include $(top_srcdir)/config/Make.rules - -CPPFLAGS := -I.. $(CPPFLAGS) -DICE_API_EXPORTS - -SLICE2CPPEFLAGS := --ice --include-dir IceE --dll-export ICE_API $(SLICE2CPPEFLAGS) - -LINKWITH := $(ICE_OS_LIBS) - -ifeq ($(STATICLIBS),yes) -$(libdir)/$(LIBNAME): $(OBJS) - rm -f $@ - $(call mklib,$@,$(OBJS)) -else -$(libdir)/$(LIBFILENAME): $(OBJS) - rm -f $@ - $(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH)) - -$(libdir)/$(SONAME): $(libdir)/$(LIBFILENAME) - rm -f $@ - ln -s $(LIBFILENAME) $@ - -$(libdir)/$(LIBNAME): $(libdir)/$(SONAME) - rm -f $@ - ln -s $(SONAME) $@ -endif - -install:: all - $(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME)) - -include .depend diff --git a/cppe/src/IceE/Makefile.mak b/cppe/src/IceE/Makefile.mak deleted file mode 100644 index 65ec01fc90c..00000000000 --- a/cppe/src/IceE/Makefile.mak +++ /dev/null @@ -1,146 +0,0 @@ -# **********************************************************************
-#
-# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..\..
-
-LIBNAME = $(top_srcdir)\lib\icee$(LIBSUFFIX).lib
-DLLNAME = $(top_srcdir)\bin\icee$(SOVERSION)$(LIBSUFFIX).dll
-
-TARGETS = $(LIBNAME) $(DLLNAME)
-
-TRANSPORT_DIR = $(top_srcdir)\src\TcpTransport
-
-TRANSPORT_OBJS = Acceptor.obj \
- Connector.obj \
- EndpointFactory.obj \
- TcpEndpoint.obj \
- Transceiver.obj
-
-LOCAL_OBJS = BasicStream.obj \
- Buffer.obj \
- BuiltinSequences.obj \
- Communicator.obj \
- Cond.obj \
- Connection.obj \
- ConvertUTF.obj \
- Current.obj \
- DefaultsAndOverrides.obj \
- Endpoint.obj \
- ExceptionBase.obj \
- FactoryTable.obj \
- FactoryTableDef.obj \
- Identity.obj \
- Incoming.obj \
- IncomingConnectionFactory.obj \
- Initialize.obj \
- Instance.obj \
- LocalException.obj \
- Locator.obj \
- LocatorInfo.obj \
- Logger.obj \
- LoggerI.obj \
- LoggerUtil.obj \
- Network.obj \
- Object.obj \
- ObjectAdapter.obj \
- ObjectAdapterFactory.obj \
- OperationMode.obj \
- Outgoing.obj \
- OutgoingConnectionFactory.obj \
- Properties.obj \
- Protocol.obj \
- Proxy.obj \
- ProxyFactory.obj \
- RecMutex.obj \
- Reference.obj \
- ReferenceFactory.obj \
- Router.obj \
- RouterInfo.obj \
- SafeStdio.obj \
- ServantManager.obj \
- Shared.obj \
- StaticMutex.obj \
- StringConverter.obj \
- StringUtil.obj \
- Thread.obj \
- ThreadException.obj \
- Time.obj \
- TraceLevels.obj \
- TraceUtil.obj \
- UnknownEndpoint.obj \
- Unicode.obj \
- UUID.obj
-
-SRCS = $(LOCAL_OBJS:.obj=.cpp) \
- $(TRANSPORT_DIR)\Acceptor.cpp \
- $(TRANSPORT_DIR)\Connector.cpp \
- $(TRANSPORT_DIR)\EndpointFactory.cpp \
- $(TRANSPORT_DIR)\TcpEndpoint.cpp \
- $(TRANSPORT_DIR)\Transceiver.cpp
-
-
-HDIR = $(includedir)\IceE
-SDIR = $(slicedir)\IceE
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-CPPFLAGS = -I.. $(CPPFLAGS) -DICE_API_EXPORTS -DFD_SETSIZE=1024 -WX -DWIN32_LEAN_AND_MEAN
-SLICE2CPPEFLAGS = --ice --include-dir IceE --dll-export ICE_API $(SLICE2CPPEFLAGS)
-
-!if "$(STATICLIBS)" != "yes" && "$(OPTIMIZE_SPEED)" != "yes" && "$(OPTIMIZE_SIZE)" != "yes"
-PDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb)
-!endif
-
-{$(TRANSPORT_DIR)\}.cpp.obj::
- $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) $<
-
-!if "$(STATICLIBS)" == "yes"
-
-$(DLLNAME):
-
-$(LIBNAME): $(LOCAL_OBJS) $(TRANSPORT_OBJS)
- $(AR) $(ARFLAGS) $(PDBFLAGS) $(LOCAL_OBJS) $(TRANSPORT_OBJS) /out:$(LIBNAME)
-
-!else
-
-$(LIBNAME): $(DLLNAME)
-
-$(DLLNAME): $(LOCAL_OBJS) $(TRANSPORT_OBJS)
- $(LINK) $(LDFLAGS) /dll $(PDBFLAGS) $(LOCAL_OBJS) $(TRANSPORT_OBJS) /out:$(DLLNAME) $(BASELIBS)
- move $(DLLNAME:.dll=.lib) $(LIBNAME)
- @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
- $(MT) -nologo -manifest $@.manifest -outputresource:$@;#2 && del /q $@.manifest
- @if exist $(DLLNAME:.dll=.exp) del /q $(DLLNAME:.dll=.exp)
-
-!endif
-
-clean::
- del /q BuiltinSequences.cpp $(HDIR)\BuiltinSequences.h
- del /q Identity.cpp $(HDIR)\Identity.h
- del /q LocatorF.cpp $(HDIR)\LocatorF.h
- del /q Locator.cpp $(HDIR)\Locator.h
- del /q RouterF.cpp $(HDIR)\RouterF.h
- del /q Router.cpp $(HDIR)\Router.h
- del /q $(LIBNAME:.lib=.*)
-
-install:: all
- copy $(LIBNAME) $(install_libdir)
-
-!if "$(STATICLIBS)" != "yes"
-
-clean::
- del /q $(DLLNAME:.dll=.*)
-
-install:: all
- copy $(LIBNAME) $(install_libdir)
- copy $(DLLNAME) $(install_bindir)
-
-!endif
-
-!include .depend
diff --git a/cppe/src/IceE/Network.cpp b/cppe/src/IceE/Network.cpp deleted file mode 100644 index d1b9702333a..00000000000 --- a/cppe/src/IceE/Network.cpp +++ /dev/null @@ -1,1157 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/StaticMutex.h> -#include <IceE/Network.h> -#include <IceE/LocalException.h> -#include <IceE/Properties.h> // For setTcpBufSize -#include <IceE/LoggerUtil.h> // For setTcpBufSize -#include <IceE/SafeStdio.h> - -#if defined(_WIN32) -# include <winsock2.h> -#elif defined(__APPLE__) || defined(__FreeBSD__) -# include <ifaddrs.h> -#else -# include <sys/ioctl.h> -# include <net/if.h> -# ifdef __sun -# include <sys/sockio.h> -# endif -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -#ifdef __sun -# define INADDR_NONE (unsigned long)-1 -#endif - -static IceUtil::StaticMutex inetMutex = ICE_STATIC_MUTEX_INITIALIZER; - -static string -inetAddrToString(const struct in_addr& in) -{ - // - // inet_ntoa uses static memory on some platforms so we protect - // access and make a copy. - // - IceUtil::StaticMutex::Lock lock(inetMutex); - return string(inet_ntoa(in)); -} - -int -IceInternal::getSocketErrno() -{ -#ifdef _WIN32 - return WSAGetLastError(); -#else - return errno; -#endif -} - -bool -IceInternal::interrupted() -{ -#ifdef _WIN32 - return WSAGetLastError() == WSAEINTR; -#else -# ifdef EPROTO - return errno == EINTR || errno == EPROTO; -# else - return errno == EINTR; -# endif -#endif -} - -bool -IceInternal::noBuffers() -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - return error == WSAENOBUFS || - error == WSAEFAULT; -#else - return errno == ENOBUFS; -#endif -} - -bool -IceInternal::wouldBlock() -{ -#ifdef _WIN32 - return WSAGetLastError() == WSAEWOULDBLOCK; -#else - return errno == EAGAIN || errno == EWOULDBLOCK; -#endif -} - -bool -IceInternal::timedout() -{ -#ifdef _WIN32 - return WSAGetLastError() == WSAETIMEDOUT; -#else - return errno == EAGAIN || errno == EWOULDBLOCK; -#endif -} - -bool -IceInternal::connectFailed() -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - return error == WSAECONNREFUSED || - error == WSAETIMEDOUT || - error == WSAENETUNREACH || - error == WSAEHOSTUNREACH || - error == WSAECONNRESET || - error == WSAESHUTDOWN || - error == WSAECONNABORTED; -#else - return errno == ECONNREFUSED || - errno == ETIMEDOUT || - errno == ENETUNREACH || - errno == EHOSTUNREACH || - errno == ECONNRESET || - errno == ESHUTDOWN || - errno == ECONNABORTED; -#endif -} - -bool -IceInternal::connectionRefused() -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - return error == WSAECONNREFUSED; -#else - return errno == ECONNREFUSED; -#endif -} - -bool -IceInternal::connectInProgress() -{ -#ifdef _WIN32 - return WSAGetLastError() == WSAEWOULDBLOCK; -#else - return errno == EINPROGRESS; -#endif -} - -bool -IceInternal::connectionLost() -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - return error == WSAECONNRESET || - error == WSAESHUTDOWN || - error == WSAENOTCONN || - error == WSAECONNABORTED; -#else - return errno == ECONNRESET || - errno == ENOTCONN || - errno == ESHUTDOWN || - errno == ECONNABORTED || - errno == EPIPE; -#endif -} - -bool -IceInternal::notConnected() -{ -#ifdef _WIN32 - return WSAGetLastError() == WSAENOTCONN; -#else - return errno == ENOTCONN; -#endif -} - -SOCKET -IceInternal::createSocket() -{ - SOCKET fd; - - fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); - if(fd == INVALID_SOCKET) - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - setTcpNoDelay(fd); - setKeepAlive(fd); - - return fd; -} - -static void -closeSocketNoThrow(SOCKET fd) -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - closesocket(fd); - WSASetLastError(error); -#else - int error = errno; - close(fd); - errno = error; -#endif -} - -void -IceInternal::closeSocket(SOCKET fd) -{ -#ifdef _WIN32 - int error = WSAGetLastError(); - if(closesocket(fd) == SOCKET_ERROR) - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - WSASetLastError(error); -#else - int error = errno; - if(close(fd) == SOCKET_ERROR) - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - errno = error; -#endif -} - -void -IceInternal::shutdownSocketWrite(SOCKET fd) -{ - if(shutdown(fd, SHUT_WR) == SOCKET_ERROR) - { - // - // Ignore errors indicating that we are shutdown already. - // -#if defined(_WIN32) - int error = WSAGetLastError(); - if(error == WSAENOTCONN) - { - return; - } -#elif defined(__APPLE__) - if(errno == ENOTCONN || errno == EINVAL) - { - return; - } -#else - if(errno == ENOTCONN) - { - return; - } -#endif - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -void -IceInternal::shutdownSocketReadWrite(SOCKET fd) -{ - if(shutdown(fd, SHUT_RDWR) == SOCKET_ERROR) - { - // - // Ignore errors indicating that we are shutdown already. - // -#if defined(_WIN32) - int error = WSAGetLastError(); - if(error == WSAENOTCONN) - { - return; - } -#elif defined(__APPLE__) - if(errno == ENOTCONN || errno == EINVAL) - { - return; - } -#else - if(errno == ENOTCONN) - { - return; - } -#endif - - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -void -IceInternal::setBlock(SOCKET fd, bool block) -{ - if(block) - { -#ifdef _WIN32 - unsigned long arg = 0; - if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } -#else - int flags = fcntl(fd, F_GETFL); - flags &= ~O_NONBLOCK; - if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = errno; - throw ex; - } -#endif - } - else - { -#ifdef _WIN32 - unsigned long arg = 1; - if(ioctlsocket(fd, FIONBIO, &arg) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } -#else - int flags = fcntl(fd, F_GETFL); - flags |= O_NONBLOCK; - if(fcntl(fd, F_SETFL, flags) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = errno; - throw ex; - } -#endif - } -} - -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -void -IceInternal::setTimeout(SOCKET fd, bool recv, int timeout) -{ - assert(timeout != 0); -#ifndef _WIN32 - struct timeval tv; - tv.tv_sec = timeout > 0 ? timeout / 1000 : 0; - tv.tv_usec = timeout > 0 ? (timeout - tv.tv_sec * 1000) * 1000 : 0; - if(setsockopt(fd, SOL_SOCKET, recv ? SO_RCVTIMEO : SO_SNDTIMEO, (char*)&tv, (int)sizeof(timeval)) == SOCKET_ERROR) -#else - int tt = timeout > 0 ? timeout : 0; - if(setsockopt(fd, SOL_SOCKET, recv ? SO_RCVTIMEO : SO_SNDTIMEO, (char*)&tt, (int)sizeof(int)) == SOCKET_ERROR) -#endif - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} -#endif - -void -IceInternal::setTcpNoDelay(SOCKET fd) -{ - int flag = 1; - if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, int(sizeof(int))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -void -IceInternal::setKeepAlive(SOCKET fd) -{ - int flag = 1; - if(setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char*)&flag, int(sizeof(int))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -void -IceInternal::setSendBufferSize(SOCKET fd, int sz) -{ - if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&sz, int(sizeof(int))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -int -IceInternal::getSendBufferSize(SOCKET fd) -{ - int sz; - socklen_t len = sizeof(sz); - if(getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char*)&sz, &len) == SOCKET_ERROR || len != sizeof(sz)) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - return sz; -} - -void -IceInternal::setRecvBufferSize(SOCKET fd, int sz) -{ - if(setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&sz, int(sizeof(int))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -int -IceInternal::getRecvBufferSize(SOCKET fd) -{ - int sz; - socklen_t len = sizeof(sz); - if(getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char*)&sz, &len) == SOCKET_ERROR || len != sizeof(sz)) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - return sz; -} - -void -IceInternal::setReuseAddress(SOCKET fd, bool reuse) -{ - int flag = reuse ? 1 : 0; - if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&flag, int(sizeof(int))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -void -IceInternal::doBind(SOCKET fd, struct sockaddr_in& addr) -{ - if(bind(fd, reinterpret_cast<struct sockaddr*>(&addr), int(sizeof(addr))) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - socklen_t len = static_cast<socklen_t>(sizeof(addr)); -#ifdef NDEBUG - getsockname(fd, reinterpret_cast<struct sockaddr*>(&addr), &len); -#else - int ret = getsockname(fd, reinterpret_cast<struct sockaddr*>(&addr), &len); - assert(ret != SOCKET_ERROR); -#endif -} - - -void -IceInternal::doConnect(SOCKET fd, struct sockaddr_in& addr, int timeout) -{ -#ifdef _WIN32 - // - // Under WinCE its not possible to find out the connection failure - // reason with SO_ERROR, so its necessary to use the WSAEVENT - // mechanism. We use the same mechanism for any Winsock platform. - // - WSAEVENT event = WSACreateEvent(); - if(event == 0) - { - closeSocketNoThrow(fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } - - if(WSAEventSelect(fd, event, FD_CONNECT) == SOCKET_ERROR) - { - int error = WSAGetLastError(); - - WSACloseEvent(event); - closeSocketNoThrow(fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } -#endif - -repeatConnect: - if(::connect(fd, reinterpret_cast<struct sockaddr*>(&addr), int(sizeof(addr))) == SOCKET_ERROR) - { - if(interrupted()) - { - goto repeatConnect; - } - - if(connectInProgress()) - { - int val; -#ifdef _WIN32 - WSAEVENT events[1]; - events[0] = event; - long tout = (timeout >= 0) ? timeout : WSA_INFINITE; - DWORD rc = WSAWaitForMultipleEvents(1, events, FALSE, tout, FALSE); - if(rc == WSA_WAIT_FAILED) - { - int error = WSAGetLastError(); - - WSACloseEvent(event); - closeSocketNoThrow(fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } - - if(rc == WSA_WAIT_TIMEOUT) - { - WSACloseEvent(event); - closeSocketNoThrow(fd); - - assert(timeout >= 0); - throw ConnectTimeoutException(__FILE__, __LINE__); - } - assert(rc == WSA_WAIT_EVENT_0); - - WSANETWORKEVENTS nevents; - if(WSAEnumNetworkEvents(fd, event, &nevents) == SOCKET_ERROR) - { - int error = WSAGetLastError(); - WSACloseEvent(event); - closeSocketNoThrow(fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } - - // - // This is necessary to be able to set the socket in blocking mode. - // - if(WSAEventSelect(fd, event, 0) == SOCKET_ERROR) - { - int error = WSAGetLastError(); - - WSACloseEvent(event); - closeSocketNoThrow(fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } - - // - // Now we close the event, because we're finished and - // this code be repeated. - // - WSACloseEvent(event); - - assert(nevents.lNetworkEvents & FD_CONNECT); - val = nevents.iErrorCode[FD_CONNECT_BIT]; -#else - repeatPoll: - struct pollfd pollFd[1]; - pollFd[0].fd = fd; - pollFd[0].events = POLLOUT; - int ret = ::poll(pollFd, 1, timeout); - if(ret == 0) - { - closeSocketNoThrow(fd); - throw ConnectTimeoutException(__FILE__, __LINE__); - } - else if(ret == SOCKET_ERROR) - { - if(interrupted()) - { - goto repeatPoll; - } - - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - // - // Strange windows bug: The following call to Sleep() is - // necessary, otherwise no error is reported through - // getsockopt. - // - //Sleep(0); - socklen_t len = static_cast<socklen_t>(sizeof(int)); - if(getsockopt(fd, SOL_SOCKET, SO_ERROR, reinterpret_cast<char*>(&val), &len) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -#endif - - if(val > 0) - { - closeSocketNoThrow(fd); -#ifdef _WIN32 - WSASetLastError(val); -#else - errno = val; -#endif - if(connectionRefused()) - { - ConnectionRefusedException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else if(connectFailed()) - { - ConnectFailedException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - - return; - } - - closeSocketNoThrow(fd); - if(connectionRefused()) - { - ConnectionRefusedException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else if(connectFailed()) - { - ConnectFailedException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } -} - -void -IceInternal::getAddress(const string& host, int port, struct sockaddr_in& addr) -{ - memset(&addr, 0, sizeof(struct sockaddr_in)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - addr.sin_addr.s_addr = inet_addr(host.c_str()); - - if(addr.sin_addr.s_addr == INADDR_NONE) - { -#ifdef _WIN32 - - // - // Windows XP has getaddrinfo(), but we don't want to require XP to run IceE. - // - - // - // gethostbyname() is thread safe on Windows, with a separate hostent per thread - // - struct hostent* entry; - int retry = 5; - do - { - entry = gethostbyname(host.c_str()); - } - while(entry == 0 && WSAGetLastError() == WSATRY_AGAIN && --retry >= 0); - - if(entry == 0) - { - DNSException ex(__FILE__, __LINE__); - - ex.error = WSAGetLastError(); - ex.host = host; - throw ex; - } - memcpy(&addr.sin_addr, entry->h_addr, entry->h_length); - -#else - - struct addrinfo* info = 0; - int retry = 5; - - struct addrinfo hints = { 0 }; - hints.ai_family = PF_INET; - - int rs = 0; - do - { - rs = getaddrinfo(host.c_str(), 0, &hints, &info); - } - while(info == 0 && rs == EAI_AGAIN && --retry >= 0); - - if(rs != 0) - { - DNSException ex(__FILE__, __LINE__); - ex.error = rs; - ex.host = host; - throw ex; - } - - assert(info->ai_family == PF_INET); - struct sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(info->ai_addr); - - addr.sin_addr.s_addr = sin->sin_addr.s_addr; - freeaddrinfo(info); - -#endif - } -} - -bool -IceInternal::compareAddress(const struct sockaddr_in& addr1, const struct sockaddr_in& addr2) -{ - return (addr1.sin_family == addr2.sin_family) && - (addr1.sin_port == addr2.sin_port) && - (addr1.sin_addr.s_addr == addr2.sin_addr.s_addr); -} - -#ifdef _WIN32 -string -IceInternal::errorToString(int error) -{ -#ifndef _WIN32_WCE - if(error < WSABASEERR) - { - LPVOID lpMsgBuf = 0; - DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR)&lpMsgBuf, - 0, - NULL); - if(ok) - { - LPCTSTR msg = (LPCTSTR)lpMsgBuf; - assert(msg && strlen((const char*)msg) > 0); - string result = (const char*)msg; - LocalFree(lpMsgBuf); - return result; - } - } -#endif - - return printfToString("error: %d", error); -} - -string -IceInternal::errorToStringDNS(int error) -{ - return errorToString(error); -} - -#else - -string -IceInternal::errorToString(int error) -{ - return strerror(error); -} - -string -IceInternal::errorToStringDNS(int error) -{ - return gai_strerror(error); -} - -#endif - -string -IceInternal::lastErrorToString() -{ -#ifdef _WIN32 - return errorToString(WSAGetLastError()); -#else - return errorToString(errno); -#endif -} - -std::string -IceInternal::fdToString(SOCKET fd) -{ - if(fd == INVALID_SOCKET) - { - return "<closed>"; - } - - socklen_t localLen = static_cast<socklen_t>(sizeof(struct sockaddr_in)); - struct sockaddr_in localAddr; - if(getsockname(fd, reinterpret_cast<struct sockaddr*>(&localAddr), &localLen) == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - bool peerNotConnected = false; - socklen_t remoteLen = static_cast<socklen_t>(sizeof(struct sockaddr_in)); - struct sockaddr_in remoteAddr; - if(getpeername(fd, reinterpret_cast<struct sockaddr*>(&remoteAddr), &remoteLen) == SOCKET_ERROR) - { - if(notConnected()) - { - peerNotConnected = true; - } - else - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - - string s; - s += "local address = "; - s += addrToString(localAddr); - if(peerNotConnected) - { - s += "\nremote address = <not connected>"; - } - else - { - s += "\nremote address = "; - s += addrToString(remoteAddr); - } - return s; -} - -std::string -IceInternal::addrToString(const struct sockaddr_in& addr) -{ - string s; - s += inetAddrToString(addr.sin_addr); - s += ":"; - s += Ice::printfToString("%d", ntohs(addr.sin_port)); - return s; -} - -#ifndef ICEE_PURE_CLIENT - -bool -IceInternal::acceptInterrupted() -{ - if(interrupted()) - { - return true; - } - -#ifdef _WIN32 - int error = WSAGetLastError(); - return error == WSAECONNABORTED || - error == WSAECONNRESET || - error == WSAETIMEDOUT; -#else - return errno == ECONNABORTED || - errno == ECONNRESET || - errno == ETIMEDOUT; -#endif -} - -SOCKET -IceInternal::doAccept(SOCKET fd) -{ - int ret; - -repeatAccept: - if((ret = ::accept(fd, 0, 0)) == INVALID_SOCKET) - { - if(acceptInterrupted()) - { - goto repeatAccept; - } - - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - setTcpNoDelay(ret); - setKeepAlive(ret); - return ret; -} - -void -IceInternal::doListen(SOCKET fd, int backlog) -{ -repeatListen: - if(::listen(fd, backlog) == SOCKET_ERROR) - { - if(interrupted()) - { - goto repeatListen; - } - - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } -} - -#endif - -vector<string> -IceInternal::getLocalHosts() -{ - vector<string> result; - -#if defined(_WIN32) - try - { - SOCKET fd = createSocket(); - - vector<unsigned char> buffer; - buffer.resize(1024); - unsigned long len = 0; - DWORD rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, &buffer[0], buffer.size(), &len, 0, 0); - if(rs == SOCKET_ERROR) - { - // - // If the buffer wasn't big enough, resize it to the - // required length and try again. - // - if(getSocketErrno() == WSAEFAULT) - { - buffer.resize(len); - rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, &buffer[0], buffer.size(), &len, 0, 0); - } - - if(rs == SOCKET_ERROR) - { - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - - // - // Add the local interface addresses. - // - SOCKET_ADDRESS_LIST* addrs = reinterpret_cast<SOCKET_ADDRESS_LIST*>(&buffer[0]); - for (int i = 0; i < addrs->iAddressCount; ++i) - { - result.push_back( - inetAddrToString(reinterpret_cast<struct sockaddr_in*>(addrs->Address[i].lpSockaddr)->sin_addr)); - } - - // - // Add the loopback interface address. - // - struct sockaddr_in addr; - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(0); - addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - result.push_back(inetAddrToString(addr.sin_addr)); - - closeSocket(fd); - } - catch(const Ice::LocalException&) - { - // - // TODO: Warning? - // - } -#elif defined(__APPLE__) || defined(__FreeBSD__) - struct ifaddrs* ifap; - if(::getifaddrs(&ifap) == SOCKET_ERROR) - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - struct ifaddrs* curr = ifap; - while(curr != 0) - { - if(curr->ifa_addr && curr->ifa_addr->sa_family == AF_INET) - { - struct sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*>(curr->ifa_addr); - if(addr->sin_addr.s_addr != 0) - { - result.push_back(inetAddrToString((*addr).sin_addr)); - } - } - - curr = curr->ifa_next; - } - - ::freeifaddrs(ifap); -#else - SOCKET fd = createSocket(); - -#ifdef _AIX - int cmd = CSIOCGIFCONF; -#else - int cmd = SIOCGIFCONF; -#endif - struct ifconf ifc; - int numaddrs = 10; - int old_ifc_len = 0; - - // - // Need to call ioctl multiple times since we do not know up front - // how many addresses there will be, and thus how large a buffer we need. - // We keep increasing the buffer size until subsequent calls return - // the same length, meaning we have all the addresses. - // - while(true) - { - int bufsize = numaddrs * sizeof(struct ifreq); - ifc.ifc_len = bufsize; - ifc.ifc_buf = (char*)malloc(bufsize); - int rs = ioctl(fd, cmd, &ifc); - if(rs == SOCKET_ERROR) - { - free(ifc.ifc_buf); - closeSocketNoThrow(fd); - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else if(ifc.ifc_len == old_ifc_len) - { - // - // Returned same length twice in a row, finished. - // - break; - } - else - { - old_ifc_len = ifc.ifc_len; - } - - numaddrs += 10; - free(ifc.ifc_buf); - } - - numaddrs = ifc.ifc_len / sizeof(struct ifreq); - struct ifreq* ifr = ifc.ifc_req; - for(int i = 0; i < numaddrs; ++i) - { - if(ifr[i].ifr_addr.sa_family == AF_INET) - { - struct sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*>(&ifr[i].ifr_addr); - if(addr->sin_addr.s_addr != 0) - { - result.push_back(inetAddrToString((*addr).sin_addr)); - } - } - } - - free(ifc.ifc_buf); - closeSocket(fd); -#endif - - return result; -} - - -void -IceInternal::setTcpBufSize(SOCKET fd, const Ice::PropertiesPtr& properties, const Ice::LoggerPtr& logger) -{ - assert(fd != INVALID_SOCKET); - - // - // By default, on Windows we use a 64KB buffer size. On Unix - // platforms, we use the system defaults. - // -#ifdef _WIN32 - const int dfltBufSize = 64 * 1024; -#else - const int dfltBufSize = 0; -#endif - Int sizeRequested; - - sizeRequested = properties->getPropertyAsIntWithDefault("Ice.TCP.RcvSize", dfltBufSize); - if(sizeRequested > 0) - { - // - // Try to set the buffer size. The kernel will silently adjust - // the size to an acceptable value. Then read the size back to - // get the size that was actually set. - // - setRecvBufferSize(fd, sizeRequested); - int size = getRecvBufferSize(fd); - if(size < sizeRequested) // Warn if the size that was set is less than the requested size. - { - Warning out(logger); - out << printfToString("TCP receive buffer size: requested size of %d adjusted to %d", sizeRequested, size); - } - } - - sizeRequested = properties->getPropertyAsIntWithDefault("Ice.TCP.SndSize", dfltBufSize); - if(sizeRequested > 0) - { - // - // Try to set the buffer size. The kernel will silently adjust - // the size to an acceptable value. Then read the size back to - // get the size that was actually set. - // - setSendBufferSize(fd, sizeRequested); - int size = getSendBufferSize(fd); - if(size < sizeRequested) // Warn if the size that was set is less than the requested size. - { - Warning out(logger); - out << printfToString("TCP send buffer size: requested size of %d adjusted to %d", sizeRequested, size); - } - } -} diff --git a/cppe/src/IceE/Network.h b/cppe/src/IceE/Network.h deleted file mode 100644 index 2274bee007c..00000000000 --- a/cppe/src/IceE/Network.h +++ /dev/null @@ -1,124 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_NETWORK_H -#define ICEE_NETWORK_H - -#ifdef __hpux -# define _XOPEN_SOURCE_EXTENDED -#endif - -#include <IceE/Config.h> -#include <IceE/PropertiesF.h> // For setTcpBufSize -#include <IceE/LoggerF.h> // For setTcpBufSize - -#ifdef _WIN32 -# include <winsock2.h> -typedef int ssize_t; -#else -# include <unistd.h> -# include <fcntl.h> -# include <sys/socket.h> - -# if defined(__hpux) -# include <sys/time.h> -# else -# include <sys/poll.h> -# endif - -# include <netinet/in.h> -# include <netinet/tcp.h> -# include <arpa/inet.h> -# include <netdb.h> -#endif - -#ifdef _WIN32 -typedef int socklen_t; -#endif - -#ifndef _WIN32 -# define SOCKET int -# define SOCKET_ERROR -1 -# define INVALID_SOCKET -1 -#endif - -#ifndef SHUT_RD -# define SHUT_RD 0 -#endif - -#ifndef SHUT_WR -# define SHUT_WR 1 -#endif - -#ifndef SHUT_RDWR -# define SHUT_RDWR 2 -#endif - -#ifndef NETDB_INTERNAL -# define NETDB_INTERNAL -1 -#endif - -#ifndef NETDB_SUCCESS -# define NETDB_SUCCESS 0 -#endif - -namespace IceInternal -{ - -bool interrupted(); -bool acceptInterrupted(); -bool noBuffers(); -bool wouldBlock(); -bool timedout(); -bool connectFailed(); -bool connectionRefused(); -bool connectInProgress(); -bool connectionLost(); -bool notConnected(); - -SOCKET createSocket(); -void closeSocket(SOCKET); -void shutdownSocketWrite(SOCKET); -void shutdownSocketReadWrite(SOCKET); - -void setBlock(SOCKET, bool); -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -void setTimeout(SOCKET, bool, int); -#endif -void setTcpNoDelay(SOCKET); -void setKeepAlive(SOCKET); -void setSendBufferSize(SOCKET, int); -int getSendBufferSize(SOCKET); -void setRecvBufferSize(SOCKET, int); -int getRecvBufferSize(SOCKET); -void setReuseAddress(SOCKET, bool); - -void doBind(SOCKET, struct sockaddr_in&); -void doListen(SOCKET, int); -void doConnect(SOCKET, struct sockaddr_in&, int); -SOCKET doAccept(SOCKET); - -void getAddress(const std::string&, int, struct sockaddr_in&); -bool compareAddress(const struct sockaddr_in&, const struct sockaddr_in&); - -std::string errorToString(int); -std::string errorToStringDNS(int); -std::string lastErrorToString(); - -std::string fdToString(SOCKET); -std::string addrToString(const struct sockaddr_in&); - -std::vector<std::string> getLocalHosts(); - void setTcpBufSize(SOCKET, const Ice::PropertiesPtr&, const Ice::LoggerPtr&); - -int getSocketErrno(); - -} - -#endif diff --git a/cppe/src/IceE/Object.cpp b/cppe/src/IceE/Object.cpp deleted file mode 100644 index 27f4b7beb63..00000000000 --- a/cppe/src/IceE/Object.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Object.h> -#include <IceE/Incoming.h> -#include <IceE/LocalException.h> -#include <IceE/SafeStdio.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Object* p) { return p; } - -bool -Ice::Object::operator==(const Object& r) const -{ - return this == &r; -} - -bool -Ice::Object::operator<(const Object& r) const -{ - return this < &r; -} - -Int -Ice::Object::ice_hash() const -{ - return static_cast<Int>(reinterpret_cast<Long>(this) >> 4); -} - -static const string __Ice__Object_ids[] = -{ - "::Ice::Object" -}; - -bool -Ice::Object::ice_isA(const string& s, const Current&) const -{ - return s == __Ice__Object_ids[0]; -} - -void -Ice::Object::ice_ping(const Current&) const -{ - // Nothing to do. -} - -vector<string> -Ice::Object::ice_ids(const Current&) const -{ - return vector<string>(&__Ice__Object_ids[0], &__Ice__Object_ids[1]); -} - -const string& -Ice::Object::ice_id(const Current&) const -{ - return __Ice__Object_ids[0]; -} - -const ::std::string& -Ice::Object::ice_staticId() -{ - return __Ice__Object_ids[0]; -} - -ObjectPtr -Ice::Object::ice_clone() const -{ - throw CloneNotImplementedException(__FILE__, __LINE__); -} - -DispatchStatus -Ice::Object::___ice_isA(Incoming& __inS, const Current& __current) -{ - BasicStream* __is = __inS.is(); - BasicStream* __os = __inS.os(); - string __id; - __is->read(__id, false); - bool __ret = ice_isA(__id, __current); - __os->write(__ret); - return DispatchOK; -} - -DispatchStatus -Ice::Object::___ice_ping(Incoming&, const Current& __current) -{ - ice_ping(__current); - return DispatchOK; -} - -DispatchStatus -Ice::Object::___ice_ids(Incoming& __inS, const Current& __current) -{ - BasicStream* __os = __inS.os(); - vector<string> __ret = ice_ids(__current); - __os->write(&__ret[0], &__ret[0] + __ret.size(), false); - return DispatchOK; -} - -DispatchStatus -Ice::Object::___ice_id(Incoming& __inS, const Current& __current) -{ - BasicStream* __os = __inS.os(); - string __ret = ice_id(__current); - __os->write(__ret, false); - return DispatchOK; -} - -string Ice::Object::__all[] = -{ - "ice_id", - "ice_ids", - "ice_isA", - "ice_ping" -}; - -DispatchStatus -Ice::Object::__dispatch(Incoming& in, const Current& current) -{ - pair<string*, string*> r = - equal_range(__all, __all + sizeof(__all) / sizeof(string), current.operation); - - if(r.first == r.second) - { - throw OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); - } - - switch(r.first - __all) - { - case 0: - { - return ___ice_id(in, current); - } - case 1: - { - return ___ice_ids(in, current); - } - case 2: - { - return ___ice_isA(in, current); - } - case 3: - { - return ___ice_ping(in, current); - } - } - - assert(false); - throw OperationNotExistException(__FILE__, __LINE__, current.id, current.facet, current.operation); -} - -static const char* -operationModeToString(OperationMode mode) -{ - switch(mode) - { - case Normal: - return "::Ice::Normal"; - - case Nonmutating: - return "::Ice::Nonmutating"; - - case Idempotent: - return "::Ice::Idempotent"; - } - - return "???"; -} - -void -Ice::Object::__invalidMode(OperationMode expected, OperationMode received) -{ - assert(expected != received); - - if(expected == Idempotent && received == Nonmutating) - { - // - // Fine: typically an old client still using the deprecated nonmutating keyword - // - - // - // Note that expected == Nonmutating and received == Idempotent is not ok: - // the server may still use the deprecated nonmutating keyword to detect updates - // and the client should not break this (deprecated) feature. - // - } - else - { - Ice::MarshalException ex(__FILE__, __LINE__); - ex.reason = Ice::printfToString("unexpected operation mode. expected = %s received = %s", - operationModeToString(expected), operationModeToString(received)); - throw ex; - } -} - -DispatchStatus -Ice::Blobject::__dispatch(Incoming& in, const Current& current) -{ - vector<Byte> inParams; - vector<Byte> outParams; - Int sz = in.is()->getReadEncapsSize(); - in.is()->readBlob(inParams, sz); - bool ok = ice_invoke(inParams, outParams, current); - in.os()->writeBlob(outParams); - if(ok) - { - return DispatchOK; - } - else - { - return DispatchUserException; - } -} diff --git a/cppe/src/IceE/ObjectAdapter.cpp b/cppe/src/IceE/ObjectAdapter.cpp deleted file mode 100644 index 11856d3519c..00000000000 --- a/cppe/src/IceE/ObjectAdapter.cpp +++ /dev/null @@ -1,965 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ObjectAdapter.h> -#include <IceE/ObjectAdapterFactory.h> -#include <IceE/UUID.h> -#include <IceE/Instance.h> -#include <IceE/ProxyFactory.h> -#include <IceE/ReferenceFactory.h> -#include <IceE/EndpointFactory.h> -#include <IceE/IncomingConnectionFactory.h> -#include <IceE/OutgoingConnectionFactory.h> -#include <IceE/ServantManager.h> -#include <IceE/LocalException.h> -#include <IceE/Properties.h> -#include <IceE/Functional.h> -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfo.h> -# include <IceE/Locator.h> -#endif -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfo.h> -# include <IceE/Router.h> -#endif -#include <IceE/Endpoint.h> -#include <IceE/LoggerUtil.h> -#include <IceE/TraceLevels.h> -#include <ctype.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(::Ice::ObjectAdapter* p) { return p; } - -string -Ice::ObjectAdapter::getName() const -{ - // - // No mutex lock necessary, _name is immutable. - // - return _name; -} - -CommunicatorPtr -Ice::ObjectAdapter::getCommunicator() const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - return _communicator; -} - -void -Ice::ObjectAdapter::activate() -{ -#ifdef ICEE_HAS_LOCATOR - LocatorInfoPtr locatorInfo; -#endif - bool printAdapterReady = false; - - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - // - // If the one off initializations of the adapter are already - // done, we just need to activate the incoming connection - // factories and we're done. - // - if(_activateOneOffDone) - { - for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - Ice::voidMemFun(&IncomingConnectionFactory::activate)); - return; - } - - // - // One off initializations of the adapter: update the locator - // registry and print the "adapter ready" message. We set the - // _waitForActivate flag to prevent deactivation from other - // threads while these one off initializations are done. - // - _waitForActivate = true; - -#ifdef ICEE_HAS_LOCATOR - locatorInfo = _locatorInfo; -#endif - printAdapterReady = _instance->initializationData().properties->getPropertyAsInt("Ice.PrintAdapterReady") > 0; - } - -#ifdef ICEE_HAS_LOCATOR - try - { - Ice::Identity dummy; - dummy.name = "dummy"; - updateLocatorRegistry(locatorInfo, createDirectProxy(dummy)); - } - catch(const Ice::LocalException&) - { - // - // If we couldn't update the locator registry, we let the - // exception go through and don't activate the adapter to - // allow to user code to retry activating the adapter - // later. - // - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - _waitForActivate = false; - notifyAll(); - } - throw; - } -#endif - - if(printAdapterReady) - { - printf("%s ready\n", _name.c_str()); - fflush(stdout); - } - - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - assert(!_deactivated); // Not possible if _waitForActivate = true; - - // - // Signal threads waiting for the activation. - // - _waitForActivate = false; - notifyAll(); - - _activateOneOffDone = true; - - for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - Ice::voidMemFun(&IncomingConnectionFactory::activate)); - } -} - -void -Ice::ObjectAdapter::hold() -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - Ice::voidMemFun(&IncomingConnectionFactory::hold)); -} - -void -Ice::ObjectAdapter::waitForHold() -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - Ice::constVoidMemFun(&IncomingConnectionFactory::waitUntilHolding)); -} - -void -Ice::ObjectAdapter::deactivate() -{ - vector<IncomingConnectionFactoryPtr> incomingConnectionFactories; - OutgoingConnectionFactoryPtr outgoingConnectionFactory; -#ifdef ICEE_HAS_LOCATOR - LocatorInfoPtr locatorInfo; -#endif - - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - // - // Ignore deactivation requests if the object adapter has already - // been deactivated. - // - if(_deactivated) - { - return; - } - - // - // Wait for activation to complete. This is necessary to not - // get out of order locator updates. - // - while(_waitForActivate) - { - wait(); - } - -#ifdef ICEE_HAS_ROUTER - if(_routerInfo) - { - // - // Remove entry from the router manager. - // - _instance->routerManager()->erase(_routerInfo->getRouter()); - - // - // Clear this object adapter with the router. - // - _routerInfo->setAdapter(0); - } -#endif - - incomingConnectionFactories = _incomingConnectionFactories; - outgoingConnectionFactory = _instance->outgoingConnectionFactory(); -#ifdef ICEE_HAS_LOCATOR - locatorInfo = _locatorInfo; -#endif - - _deactivated = true; - - notifyAll(); - } - -#ifdef ICEE_HAS_LOCATOR - try - { - updateLocatorRegistry(locatorInfo, 0); - } - catch(const Ice::LocalException&) - { - // - // We can't throw exceptions in deactivate so we ignore - // failures to update the locator registry. - // - } -#endif - - // - // Must be called outside the thread synchronization, because - // Connection::destroy() might block when sending a CloseConnection - // message. - // - for_each(incomingConnectionFactories.begin(), incomingConnectionFactories.end(), - Ice::voidMemFun(&IncomingConnectionFactory::destroy)); - - // - // Must be called outside the thread synchronization, because - // changing the object adapter might block if there are still - // requests being dispatched. - // - outgoingConnectionFactory->removeAdapter(this); -} - -void -Ice::ObjectAdapter::waitForDeactivate() -{ - vector<IceInternal::IncomingConnectionFactoryPtr> incomingConnectionFactories; - - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - if(_destroyed) - { - return; - } - - // - // Wait for deactivation of the adapter itself, and for - // the return of all direct method calls using this adapter. - // - while(!_deactivated || _directCount > 0) - { - wait(); - } - - incomingConnectionFactories = _incomingConnectionFactories; - } - - // - // Now we wait until all incoming connection factories are - // finished. - // - for_each(incomingConnectionFactories.begin(), incomingConnectionFactories.end(), - Ice::voidMemFun(&IncomingConnectionFactory::waitUntilFinished)); -} - -bool -Ice::ObjectAdapter::isDeactivated() const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - return _deactivated; -} - -void -Ice::ObjectAdapter::destroy() -{ - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - // - // Another thread is in the process of destroying the object - // adapter. Wait for it to finish. - // - while(_destroying) - { - wait(); - } - - // - // Object adapter is already destroyed. - // - if(_destroyed) - { - return; - } - - _destroying = true; - } - - // - // Deactivate and wait for completion. - // - deactivate(); - waitForDeactivate(); - - // - // Now it's also time to clean up our servants and servant - // locators. - // - _servantManager->destroy(); - - ObjectAdapterFactoryPtr objectAdapterFactory; - - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - // - // Signal that destroy is complete. - // - _destroying = false; - _destroyed = true; - notifyAll(); - - // - // We're done, now we can throw away all incoming connection - // factories. - // - _incomingConnectionFactories.clear(); - - // - // Remove object references (some of them cyclic). - // - _instance = 0; - _communicator = 0; -#ifdef ICEE_HAS_ROUTER - _routerEndpoints.clear(); - _routerInfo = 0; -#endif - _publishedEndpoints.clear(); -#ifdef ICEE_HAS_LOCATOR - _locatorInfo = 0; -#endif - - objectAdapterFactory = _objectAdapterFactory; - _objectAdapterFactory = 0; - } - - if(objectAdapterFactory) - { - objectAdapterFactory->removeObjectAdapter(_name); - } -} - -ObjectPrx -Ice::ObjectAdapter::add(const ObjectPtr& object, const Identity& ident) -{ - return addFacet(object, ident, ""); -} - -ObjectPrx -Ice::ObjectAdapter::addFacet(const ObjectPtr& object, const Identity& ident, const string& facet) -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - _servantManager->addServant(object, ident, facet); - - return newProxy(ident, facet); -} - -ObjectPrx -Ice::ObjectAdapter::addWithUUID(const ObjectPtr& object) -{ - return addFacetWithUUID(object, ""); -} - -ObjectPrx -Ice::ObjectAdapter::addFacetWithUUID(const ObjectPtr& object, const string& facet) -{ - Identity ident; - ident.name = IceUtil::generateUUID(); - return addFacet(object, ident, facet); -} - -ObjectPtr -Ice::ObjectAdapter::remove(const Identity& ident) -{ - return removeFacet(ident, ""); -} - -ObjectPtr -Ice::ObjectAdapter::removeFacet(const Identity& ident, const string& facet) -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return _servantManager->removeServant(ident, facet); -} - -FacetMap -Ice::ObjectAdapter::removeAllFacets(const Identity& ident) -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return _servantManager->removeAllFacets(ident); -} - -ObjectPtr -Ice::ObjectAdapter::find(const Identity& ident) const -{ - return findFacet(ident, ""); -} - -ObjectPtr -Ice::ObjectAdapter::findFacet(const Identity& ident, const string& facet) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return _servantManager->findServant(ident, facet); -} - -FacetMap -Ice::ObjectAdapter::findAllFacets(const Identity& ident) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return _servantManager->findAllFacets(ident); -} - -ObjectPtr -Ice::ObjectAdapter::findByProxy(const ObjectPrx& proxy) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - ReferencePtr ref = proxy->__reference(); - return findFacet(ref->getIdentity(), ref->getFacet()); -} - -ObjectPrx -Ice::ObjectAdapter::createProxy(const Identity& ident) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return newProxy(ident, ""); -} - -#ifdef ICEE_HAS_LOCATOR -ObjectPrx -Ice::ObjectAdapter::createDirectProxy(const Identity& ident) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return newDirectProxy(ident, ""); -} - -ObjectPrx -Ice::ObjectAdapter::createIndirectProxy(const Identity& ident) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - return newIndirectProxy(ident, "", _id); -} -#endif - -ObjectPrx -Ice::ObjectAdapter::createReverseProxy(const Identity& ident) const -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - checkIdentity(ident); - - // - // Get all incoming connections for this object adapter. - // - vector<ConnectionPtr> connections; - vector<IncomingConnectionFactoryPtr>::const_iterator p; - for(p = _incomingConnectionFactories.begin(); p != _incomingConnectionFactories.end(); ++p) - { - list<ConnectionPtr> cons = (*p)->connections(); - copy(cons.begin(), cons.end(), back_inserter(connections)); - } - - // - // Create a reference and return a reverse proxy for this - // reference. - // - vector<EndpointPtr> endpoints; - ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), "", ReferenceModeTwoway, - connections); - return _instance->proxyFactory()->referenceToProxy(ref); -} - -#ifdef ICEE_HAS_LOCATOR -void -Ice::ObjectAdapter::setLocator(const LocatorPrx& locator) -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - _locatorInfo = _instance->locatorManager()->get(locator); -} -#endif - -void -Ice::ObjectAdapter::flushBatchRequests() -{ - vector<IncomingConnectionFactoryPtr> f; - { - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - f = _incomingConnectionFactories; - } - for_each(f.begin(), f.end(), Ice::voidMemFun(&IncomingConnectionFactory::flushBatchRequests)); -} - -void -Ice::ObjectAdapter::incDirectCount() -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - checkForDeactivation(); - - assert(_directCount >= 0); - ++_directCount; -} - -void -Ice::ObjectAdapter::decDirectCount() -{ - IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - - // Not check for deactivation here! - - assert(_instance); // Must not be called after waitForDeactivate(). - - assert(_directCount > 0); - if(--_directCount == 0) - { - notifyAll(); - } -} - -ServantManagerPtr -Ice::ObjectAdapter::getServantManager() const -{ - // - // No mutex lock necessary, _servantManager is immutable. - // - return _servantManager; -} - -Ice::ObjectAdapter::ObjectAdapter(const InstancePtr& instance, const CommunicatorPtr& communicator, - const ObjectAdapterFactoryPtr& objectAdapterFactory, - const string& name, const string& endpointInfo -#ifdef ICEE_HAS_ROUTER - , const RouterPrx& router -#endif - ) : - _deactivated(false), - _instance(instance), - _communicator(communicator), - _objectAdapterFactory(objectAdapterFactory), - _servantManager(new ServantManager(instance, name)), - _activateOneOffDone(false), - _name(name), -#ifdef ICEE_HAS_LOCATOR - _id(instance->initializationData().properties->getProperty(name + ".AdapterId")), - _replicaGroupId(instance->initializationData().properties->getProperty(name + ".ReplicaGroupId")), -#endif - _directCount(0), - _waitForActivate(false), - _destroying(false), - _destroyed(false) -{ - __setNoDelete(true); - try - { -#ifdef ICEE_HAS_ROUTER - if(!router) - { - string routerStr = _instance->initializationData().properties->getProperty(_name + ".Router"); - if(!routerStr.empty()) - { - const_cast<RouterPrx&>(router) = - RouterPrx::uncheckedCast(_instance->proxyFactory()->stringToProxy(routerStr)); - } - } - if(router) - { - _routerInfo = _instance->routerManager()->get(router); - if(_routerInfo) - { - // - // Make sure this router is not already registered with another adapter. - // - if(_routerInfo->getAdapter()) - { - throw AlreadyRegisteredException(__FILE__, __LINE__, "object adapter with router", - _instance->identityToString(router->ice_getIdentity())); - } - - // - // Add the router's server proxy endpoints to this object - // adapter. - // - vector<EndpointPtr> endpoints = _routerInfo->getServerEndpoints(); - copy(endpoints.begin(), endpoints.end(), back_inserter(_routerEndpoints)); - sort(_routerEndpoints.begin(), _routerEndpoints.end()); // Must be sorted. - _routerEndpoints.erase(unique(_routerEndpoints.begin(), _routerEndpoints.end()), - _routerEndpoints.end()); - - // - // Associate this object adapter with the router. This way, - // new outgoing connections to the router's client proxy will - // use this object adapter for callbacks. - // - _routerInfo->setAdapter(this); - - // - // Also modify all existing outgoing connections to the - // router's client proxy to use this object adapter for - // callbacks. - // - _instance->outgoingConnectionFactory()->setRouterInfo(_routerInfo); - } - } - else -#endif - { - // - // Parse the endpoints, but don't store them in the adapter. - // The connection factory might change it, for example, to - // fill in the real port number. - // - vector<EndpointPtr> endpoints = parseEndpoints(endpointInfo); - for(vector<EndpointPtr>::iterator p = endpoints.begin(); p != endpoints.end(); ++p) - { - _incomingConnectionFactories.push_back(new IncomingConnectionFactory(_instance, *p, this)); - } - if(endpoints.empty()) - { - TraceLevelsPtr tl = _instance->traceLevels(); - if(tl->network >= 2) - { - Trace out(_instance->initializationData().logger, tl->networkCat); - out << "created adapter `" << name << "' without endpoints"; - } - } - - // - // Parse published endpoints. These are used in proxies - // instead of the connection factory endpoints. - // - string endpts = _instance->initializationData().properties->getProperty(name + ".PublishedEndpoints"); - _publishedEndpoints = parseEndpoints(endpts); - if(_publishedEndpoints.empty()) - { - transform(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), - back_inserter(_publishedEndpoints), Ice::constMemFun(&IncomingConnectionFactory::endpoint)); - } - - // - // Filter out any endpoints that are not meant to be published. - // - _publishedEndpoints.erase(remove_if(_publishedEndpoints.begin(), _publishedEndpoints.end(), - not1(Ice::constMemFun(&Endpoint::publish))), _publishedEndpoints.end()); - } - -#ifdef ICEE_HAS_LOCATOR - string locator = _instance->initializationData().properties->getProperty(_name + ".Locator"); - if(!locator.empty()) - { - setLocator(LocatorPrx::uncheckedCast(_instance->proxyFactory()->stringToProxy(locator))); - } - else - { - setLocator(_instance->referenceFactory()->getDefaultLocator()); - } -#endif - } - catch(...) - { - deactivate(); - waitForDeactivate(); - __setNoDelete(false); - throw; - } - __setNoDelete(false); -} - -Ice::ObjectAdapter::~ObjectAdapter() -{ - if(!_deactivated) - { - Warning out(_instance->initializationData().logger); - out << "object adapter `" << _name << "' has not been deactivated"; - } - else if(!_destroyed) - { - Warning out(_instance->initializationData().logger); - out << "object adapter `" << _name << "' has not been destroyed"; - } - else - { - //assert(!_servantManager); // We don't clear this reference, it needs to be immutable. - assert(!_communicator); - assert(_incomingConnectionFactories.empty()); - assert(_directCount == 0); - assert(!_waitForActivate); - } -} - -ObjectPrx -Ice::ObjectAdapter::newProxy(const Identity& ident, const string& facet) const -{ -#ifdef ICEE_HAS_LOCATOR - if(_id.empty()) - { -#endif - return newDirectProxy(ident, facet); -#ifdef ICEE_HAS_LOCATOR - } - else if(_replicaGroupId.empty()) - { - return newIndirectProxy(ident, facet, _id); - } - else - { - return newIndirectProxy(ident, facet, _replicaGroupId); - } -#endif -} - -ObjectPrx -Ice::ObjectAdapter::newDirectProxy(const Identity& ident, const string& facet) const -{ - vector<EndpointPtr> endpoints = _publishedEndpoints; - - // - // Now we also add the endpoints of the router's server proxy, if - // any. This way, object references created by this object adapter - // will also point to the router's server proxy endpoints. - // -#ifdef ICEE_HAS_ROUTER - copy(_routerEndpoints.begin(), _routerEndpoints.end(), back_inserter(endpoints)); -#endif - - // - // Create a reference and return a proxy for this reference. - // -#ifdef ICEE_HAS_ROUTER - ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, - false, endpoints, 0); -#else - ReferencePtr ref = _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, - false, endpoints); -#endif - return _instance->proxyFactory()->referenceToProxy(ref); - -} - -#ifdef ICEE_HAS_LOCATOR -ObjectPrx -Ice::ObjectAdapter::newIndirectProxy(const Identity& ident, const string& facet, const string& id) const -{ - // - // Create a reference with the adapter id. - // -#ifdef ICEE_HAS_ROUTER - ReferencePtr ref = - _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, false, id, 0, - _locatorInfo); -#else - ReferencePtr ref = - _instance->referenceFactory()->create(ident, Ice::Context(), facet, ReferenceModeTwoway, false, id, - _locatorInfo); -#endif - - // - // Return a proxy for the reference. - // - return _instance->proxyFactory()->referenceToProxy(ref); -} -#endif - -void -Ice::ObjectAdapter::checkForDeactivation() const -{ - if(_deactivated) - { - ObjectAdapterDeactivatedException ex(__FILE__, __LINE__); - ex.name = _name; - throw ex; - } -} - -void -Ice::ObjectAdapter::checkIdentity(const Identity& ident) -{ - if(ident.name.size() == 0) - { - IllegalIdentityException e(__FILE__, __LINE__); - e.id = ident; - throw e; - } -} - -vector<EndpointPtr> -Ice::ObjectAdapter::parseEndpoints(const string& str) const -{ - string endpts = str; - transform(endpts.begin(), endpts.end(), endpts.begin(), ::tolower); - - string::size_type beg; - string::size_type end = 0; - - vector<EndpointPtr> endpoints; - while(end < endpts.length()) - { - const string delim = " \t\n\r"; - - beg = endpts.find_first_not_of(delim, end); - if(beg == string::npos) - { - break; - } - - end = endpts.find(':', beg); - if(end == string::npos) - { - end = endpts.length(); - } - - if(end == beg) - { - ++end; - continue; - } - - string s = endpts.substr(beg, end - beg); - EndpointPtr endp = _instance->endpointFactory()->create(s); - if(endp == 0) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - vector<EndpointPtr> endps = endp->expand(true); - endpoints.insert(endpoints.end(), endps.begin(), endps.end()); - - ++end; - } - - return endpoints; -} - -#ifdef ICEE_HAS_LOCATOR -void -ObjectAdapter::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locatorInfo, const Ice::ObjectPrx& proxy) -{ - if(_id.empty()) - { - return; // Nothing to update. - } - - // - // We must get and call on the locator registry outside the thread - // synchronization to avoid deadlocks. (we can't make remote calls - // within the OA synchronization because the remote call will - // indirectly call isLocal() on this OA with the OA factory - // locked). - // - // TODO: This might throw if we can't connect to the - // locator. Shall we raise a special exception for the activate - // operation instead of a non obvious network exception? - // - LocatorRegistryPrx locatorRegistry = locatorInfo ? locatorInfo->getLocatorRegistry() : LocatorRegistryPrx(); - if(!locatorRegistry) - { - return; - } - - if(!_id.empty()) - { - try - { - if(_replicaGroupId.empty()) - { - locatorRegistry->setAdapterDirectProxy(_id, proxy); - } - else - { - locatorRegistry->setReplicatedAdapterDirectProxy(_id, _replicaGroupId, proxy); - } - } - catch(const AdapterNotFoundException&) - { - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "object adapter"; - ex.id = _id; - throw ex; - } - catch(const InvalidReplicaGroupIdException&) - { - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "replica group"; - ex.id = _replicaGroupId; - throw ex; - } - catch(const AdapterAlreadyActiveException&) - { - ObjectAdapterIdInUseException ex(__FILE__, __LINE__); - ex.id = _id; - throw ex; - } - } -} -#endif diff --git a/cppe/src/IceE/ObjectAdapterFactory.cpp b/cppe/src/IceE/ObjectAdapterFactory.cpp deleted file mode 100644 index 88291f3e5ea..00000000000 --- a/cppe/src/IceE/ObjectAdapterFactory.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ObjectAdapterFactory.h> -#include <IceE/ObjectAdapter.h> -#include <IceE/LocalException.h> -#include <IceE/Functional.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(ObjectAdapterFactory* p) { return p; } - -void -IceInternal::ObjectAdapterFactory::shutdown() -{ - map<string, ObjectAdapterPtr> adapters; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Ignore shutdown requests if the object adapter factory has - // already been shut down. - // - if(!_instance) - { - return; - } - - adapters = _adapters; - - _instance = 0; - _communicator = 0; - - notifyAll(); - } - - // - // Deactivate outside the thread synchronization, to avoid - // deadlocks. - // - //for_each(adapters.begin(), adapters.end(), - //Ice::secondVoidMemFun<const string, ObjectAdapter>(&ObjectAdapter::deactivate)); - for(map<string, ObjectAdapterPtr>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) - { - p->second->deactivate(); - } - -} - -void -IceInternal::ObjectAdapterFactory::waitForShutdown() -{ - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // First we wait for the shutdown of the factory itself. - // - while(_instance) - { - wait(); - } - - // - // If some other thread is currently shutting down, we wait - // until this thread is finished. - // - while(_waitForShutdown) - { - wait(); - } - _waitForShutdown = true; - } - - // - // Now we wait for deactivation of each object adapter. - // - for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) - { - p->second->waitForDeactivate(); - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Signal that waiting is complete. - // - _waitForShutdown = false; - notifyAll(); - } -} - -bool -IceInternal::ObjectAdapterFactory::isShutdown() const -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - return _instance == 0; -} - -void -IceInternal::ObjectAdapterFactory::destroy() -{ - // - // First wait for shutdown to finish. - // - waitForShutdown(); - - map<string, ObjectAdapterPtr> adapters; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - adapters = _adapters; - _adapters.clear(); - } - - // - // Now we destroy each object adapter. - // - for(map<string, ObjectAdapterPtr>::const_iterator p = adapters.begin(); p != adapters.end(); ++p) - { - p->second->destroy(); - } -} - -ObjectAdapterPtr -IceInternal::ObjectAdapterFactory::createObjectAdapter(const string& name, const string& endpoints -#ifdef ICEE_HAS_ROUTER - , const RouterPrx& router -#endif - ) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(!_instance) - { - throw ObjectAdapterDeactivatedException(__FILE__, __LINE__); - } - - map<string, ObjectAdapterPtr>::iterator p = _adapters.find(name); - if(p != _adapters.end()) - { - throw AlreadyRegisteredException(__FILE__, __LINE__, "object adapter", name); - } - - ObjectAdapterPtr adapter = new ObjectAdapter(_instance, _communicator, this, name, endpoints -#ifdef ICEE_HAS_ROUTER - , router -#endif - ); - _adapters.insert(make_pair(name, adapter)); - return adapter; -} - -void -IceInternal::ObjectAdapterFactory::removeObjectAdapter(const string& name) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_waitForShutdown) - { - return; - } - - _adapters.erase(name); -} - -namespace IceInternal { - -struct FlushAdapter -{ - void operator() (ObjectAdapterPtr p) - { - p->flushBatchRequests(); - } -}; - -} - -void -IceInternal::ObjectAdapterFactory::flushBatchRequests() const -{ - list<ObjectAdapterPtr> a; - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - for(map<string, ObjectAdapterPtr>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p) - { - a.push_back(p->second); - } - } - for_each(a.begin(), a.end(), FlushAdapter()); -} - -IceInternal::ObjectAdapterFactory::ObjectAdapterFactory(const InstancePtr& instance, - const CommunicatorPtr& communicator) : - _instance(instance), - _communicator(communicator), - _waitForShutdown(false) -{ -} - -IceInternal::ObjectAdapterFactory::~ObjectAdapterFactory() -{ - assert(!_instance); - assert(!_communicator); - assert(_adapters.empty()); - assert(!_waitForShutdown); -} diff --git a/cppe/src/IceE/ObjectAdapterFactory.h b/cppe/src/IceE/ObjectAdapterFactory.h deleted file mode 100644 index d0ebb12746d..00000000000 --- a/cppe/src/IceE/ObjectAdapterFactory.h +++ /dev/null @@ -1,59 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_OBJECT_ADAPTER_FACTORY_H -#define ICEE_OBJECT_ADAPTER_FACTORY_H - -#include <IceE/ObjectAdapterF.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterF.h> -#endif -#include <IceE/ProxyF.h> -#include <IceE/CommunicatorF.h> -#include <IceE/InstanceF.h> - -#include <IceE/Shared.h> -#include <IceE/Mutex.h> -#include <IceE/Monitor.h> - -namespace IceInternal -{ - -class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::Monitor< ::IceUtil::Mutex> -{ -public: - - void shutdown(); - void waitForShutdown(); - bool isShutdown() const; - void destroy(); - - ::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string& -#ifdef ICEE_HAS_ROUTER - , const ::Ice::RouterPrx& -#endif - ); - void removeObjectAdapter(const std::string&); - void flushBatchRequests() const; - -private: - - ObjectAdapterFactory(const InstancePtr&, const ::Ice::CommunicatorPtr&); - virtual ~ObjectAdapterFactory(); - friend class Instance; - - InstancePtr _instance; - ::Ice::CommunicatorPtr _communicator; - std::map<std::string, ::Ice::ObjectAdapterPtr> _adapters; - bool _waitForShutdown; -}; - -} - -#endif diff --git a/cppe/src/IceE/OperationMode.cpp b/cppe/src/IceE/OperationMode.cpp deleted file mode 100644 index 5df8f49b40b..00000000000 --- a/cppe/src/IceE/OperationMode.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/OperationMode.h> -#include <IceE/BasicStream.h> - -void -Ice::__write(::IceInternal::BasicStream* __os, ::Ice::OperationMode v) -{ - __os->write(static_cast< ::Ice::Byte>(v)); -} - -void -Ice::__read(::IceInternal::BasicStream* __is, ::Ice::OperationMode& v) -{ - ::Ice::Byte val; - __is->read(val); - v = static_cast< ::Ice::OperationMode>(val); -} diff --git a/cppe/src/IceE/Outgoing.cpp b/cppe/src/IceE/Outgoing.cpp deleted file mode 100644 index 79fbc3c9f35..00000000000 --- a/cppe/src/IceE/Outgoing.cpp +++ /dev/null @@ -1,426 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/LocalException.h> // Need to be included before Outgoing.h because of std::auto_ptr<LocalException> -#include <IceE/Outgoing.h> -#include <IceE/ReplyStatus.h> -#include <IceE/Connection.h> -#include <IceE/Reference.h> -#include <IceE/Instance.h> -#include <IceE/Protocol.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalException& ex, bool r) : - _retry(r) -{ - _ex.reset(dynamic_cast<LocalException*>(ex.ice_clone())); -} - -IceInternal::LocalExceptionWrapper::LocalExceptionWrapper(const LocalExceptionWrapper& ex) : - _retry(ex._retry) -{ - _ex.reset(dynamic_cast<LocalException*>(ex.get()->ice_clone())); -} - -const LocalException* -IceInternal::LocalExceptionWrapper::get() const -{ - assert(_ex.get()); - return _ex.get(); -} - -bool -IceInternal::LocalExceptionWrapper::retry() const -{ - return _retry; -} - -IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const string& operation, - OperationMode mode, const Context* context) : - _connection(connection), - _reference(ref), - _state(StateUnsent), - _stream(ref->getInstance().get(), ref->getInstance()->messageSizeMax() -#ifdef ICEE_HAS_WSTRING - , ref->getInstance()->initializationData().stringConverter, - ref->getInstance()->initializationData().wstringConverter -#endif - ) -{ - switch(_reference->getMode()) - { - case ReferenceModeTwoway: - case ReferenceModeOneway: - { - _stream.writeBlob(requestHdr, sizeof(requestHdr)); - break; - } - - case ReferenceModeBatchOneway: -#ifdef ICEE_HAS_BATCH - { - _connection->prepareBatchRequest(&_stream); - break; - } -#endif - case ReferenceModeDatagram: - case ReferenceModeBatchDatagram: - { - assert(false); - break; - } - } - -// _reference->getIdentity().__write(&_stream); - _stream.write(_reference->getIdentity().name); // Directly write name for performance reasons. - _stream.write(_reference->getIdentity().category); // Directly write category for performance reasons. - - // - // For compatibility with the old FacetPath we still write an - // array of strings (we don't use the basic stream string array - // method here for performance reasons.) - // - if(_reference->getFacet().empty()) - { - _stream.writeSize(0); - } - else - { - _stream.writeSize(1); - _stream.write(_reference->getFacet()); - } - - _stream.write(operation, false); - - _stream.write(static_cast<Byte>(mode)); - - if(context == 0) - { - context = _reference->getContext(); - } - - _stream.writeSize(Int(context->size())); - Context::const_iterator p; - for(p = context->begin(); p != context->end(); ++p) - { - _stream.write(p->first); - _stream.write(p->second); - } - - // - // Input and output parameters are always sent in an - // encapsulation, which makes it possible to forward requests as - // blobs. - // - _stream.startWriteEncaps(); -} - -bool -IceInternal::Outgoing::invoke() -{ - assert(_state == StateUnsent); - _state = StateInProgress; - - _stream.endWriteEncaps(); - - switch(_reference->getMode()) - { - case ReferenceModeTwoway: - { - // - // We let all exceptions raised by sending directly - // propagate to the caller, because they can be retried - // without violating "at-most-once". In case of such - // exceptions, the connection object does not call back on - // this object, so we don't need to lock the mutex, keep - // track of state, or save exceptions. - // - _connection->sendRequest(&_stream, this); - - if(_exception.get()) - { - // - // A CloseConnectionException indicates graceful - // server shutdown, and is therefore always repeatable - // without violating "at-most-once". That's because by - // sending a close connection message, the server - // guarantees that all outstanding requests can safely - // be repeated. - // - // An ObjectNotExistException can always be retried as - // well without violating "at-most-once". - // - if(dynamic_cast<CloseConnectionException*>(_exception.get()) || - dynamic_cast<ObjectNotExistException*>(_exception.get())) - { - _exception->ice_throw(); - } - - // - // Throw the exception wrapped in a LocalExceptionWrapper, to - // indicate that the request cannot be resent without - // potentially violating the "at-most-once" principle. - // - throw LocalExceptionWrapper(*_exception.get(), false); - } - - if(_state == StateUserException) - { - return false; - } - - assert(_state == StateOK); - break; - } - - case ReferenceModeOneway: - { - // - // For oneway requests, the connection object - // never calls back on this object. Therefore we don't - // need to lock the mutex or save exceptions. We simply - // let all exceptions from sending propagate to the - // caller, because such exceptions can be retried without - // violating "at-most-once". - // - _connection->sendRequest(&_stream, 0); - break; - } - - case ReferenceModeBatchOneway: -#ifdef ICEE_HAS_BATCH - { - // - // For batch oneways, the same rules as for - // regular oneways (see comment above) - // apply. - // - _connection->finishBatchRequest(&_stream); - break; - } -#endif - case ReferenceModeDatagram: - case ReferenceModeBatchDatagram: - { - assert(false); - return false; - } - } - - return true; -} - -void -IceInternal::Outgoing::abort(const LocalException& ex) -{ - assert(_state == StateUnsent); - - // - // If we didn't finish a batch oneway request, we must - // notify the connection about that we give up ownership of the - // batch stream. - // -#ifdef ICEE_HAS_BATCH - if(_reference->getMode() == ReferenceModeBatchOneway) - { - _connection->abortBatchRequest(); - - // - // If we abort a batch requests, we cannot retry, because not - // only the batch request that caused the problem will be - // aborted, but all other requests in the batch as well. - // - throw LocalExceptionWrapper(ex, false); - } -#endif - - ex.ice_throw(); -} - -void -IceInternal::Outgoing::finished(BasicStream& is) -{ - assert(_reference->getMode() == ReferenceModeTwoway); // Can only be called for twoways. - assert(_state <= StateInProgress); - - // - // Only swap the stream if the given stream is not this Outgoing object stream! - // - if(&is != &_stream) - { - _stream.swap(is); - } - - Byte replyStatus; - _stream.read(replyStatus); - - switch(replyStatus) - { - case replyOK: - { - // - // Input and output parameters are always sent in an - // encapsulation, which makes it possible to forward - // oneway requests as blobs. - // - _stream.startReadEncaps(); - _state = StateOK; // The state must be set last, in case there is an exception. - break; - } - - case replyUserException: - { - // - // Input and output parameters are always sent in an - // encapsulation, which makes it possible to forward - // oneway requests as blobs. - // - _stream.startReadEncaps(); - _state = StateUserException; // The state must be set last, in case there is an exception. - break; - } - - case replyObjectNotExist: - case replyFacetNotExist: - case replyOperationNotExist: - { - // - // Don't read the exception members directly into the - // exception. Otherwise if reading fails and raises an - // exception, you will have a memory leak. - // - Identity ident; - ident.__read(&_stream); - - // - // For compatibility with the old FacetPath. - // - vector<string> facetPath; - _stream.read(facetPath); - string facet; - if(!facetPath.empty()) - { - if(facetPath.size() > 1) - { - throw MarshalException(__FILE__, __LINE__); - } - facet.swap(facetPath[0]); - } - - string operation; - _stream.read(operation, false); - - RequestFailedException* ex; - switch(replyStatus) - { - case replyObjectNotExist: - { - ex = new ObjectNotExistException(__FILE__, __LINE__); - break; - } - - case replyFacetNotExist: - { - ex = new FacetNotExistException(__FILE__, __LINE__); - break; - } - - case replyOperationNotExist: - { - ex = new OperationNotExistException(__FILE__, __LINE__); - break; - } - - default: - { - ex = 0; // To keep the compiler from complaining. - assert(false); - break; - } - } - - ex->id = ident; - ex->facet = facet; - ex->operation = operation; - _exception.reset(ex); - - _state = StateLocalException; // The state must be set last, in case there is an exception. - break; - } - - case replyUnknownException: - case replyUnknownLocalException: - case replyUnknownUserException: - { - // - // Don't read the exception members directly into the - // exception. Otherwise if reading fails and raises an - // exception, you will have a memory leak. - // - string unknown; - _stream.read(unknown, false); - - UnknownException* ex; - switch(replyStatus) - { - case replyUnknownException: - { - ex = new UnknownException(__FILE__, __LINE__); - break; - } - - case replyUnknownLocalException: - { - ex = new UnknownLocalException(__FILE__, __LINE__); - break; - } - - case replyUnknownUserException: - { - ex = new UnknownUserException(__FILE__, __LINE__); - break; - } - - default: - { - ex = 0; // To keep the compiler from complaining. - assert(false); - break; - } - } - - ex->unknown = unknown; - _exception.reset(ex); - - _state = StateLocalException; // The state must be set last, in case there is an exception. - break; - } - - default: - { - //_exception.reset(new UnknownReplyStatusException(__FILE__, __LINE__)); - _exception.reset(new ProtocolException(__FILE__, __LINE__, "unknown reply status")); - _state = StateLocalException; - break; - } - } -} - -void -IceInternal::Outgoing::finished(const LocalException& ex) -{ - assert(_reference->getMode() == ReferenceModeTwoway); // Can only be called for twoways. - assert(_state <= StateInProgress); - - _state = StateLocalException; - _exception.reset(dynamic_cast<LocalException*>(ex.ice_clone())); -} diff --git a/cppe/src/IceE/OutgoingConnectionFactory.cpp b/cppe/src/IceE/OutgoingConnectionFactory.cpp deleted file mode 100644 index 674fb5b3f0d..00000000000 --- a/cppe/src/IceE/OutgoingConnectionFactory.cpp +++ /dev/null @@ -1,463 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/OutgoingConnectionFactory.h> -#include <IceE/Connection.h> -#include <IceE/Instance.h> -#include <IceE/LoggerUtil.h> -#include <IceE/TraceLevels.h> -#include <IceE/DefaultsAndOverrides.h> -#include <IceE/Connector.h> -#include <IceE/Endpoint.h> -#include <IceE/RouterInfo.h> -#include <IceE/LocalException.h> -#include <IceE/Functional.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/Reference.h> -#endif -#include <list> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(OutgoingConnectionFactory* p) { return p; } - -void -IceInternal::OutgoingConnectionFactory::destroy() -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_destroyed) - { - return; - } - -#ifdef _STLP_BEGIN_NAMESPACE - // voidbind2nd is an STLport extension for broken compilers in IceE/Functional.h - for_each(_connections.begin(), _connections.end(), - voidbind2nd(Ice::secondVoidMemFun1<EndpointPtr, Connection, Connection::DestructionReason> - (&Connection::destroy), Connection::CommunicatorDestroyed)); -#else - for_each(_connections.begin(), _connections.end(), - bind2nd(Ice::secondVoidMemFun1<const EndpointPtr, Connection, Connection::DestructionReason> - (&Connection::destroy), Connection::CommunicatorDestroyed)); -#endif - - _destroyed = true; - notifyAll(); -} - -void -IceInternal::OutgoingConnectionFactory::waitUntilFinished() -{ - multimap<EndpointPtr, ConnectionPtr> connections; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // First we wait until the factory is destroyed. We also wait - // until there are no pending connections anymore. Only then - // we can be sure the _connections contains all connections. - // - while(!_destroyed || !_pending.empty()) - { - wait(); - } - - // - // We want to wait until all connections are finished outside the - // thread synchronization. - // - connections.swap(_connections); - } - - for_each(connections.begin(), connections.end(), - Ice::secondVoidMemFun<const EndpointPtr, Connection>(&Connection::waitUntilFinished)); -} - -ConnectionPtr -IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts) -{ - assert(!endpts.empty()); - vector<EndpointPtr> endpoints = endpts; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_destroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - // - // Reap connections for which destruction has completed. - // - std::multimap<EndpointPtr, ConnectionPtr>::iterator p = _connections.begin(); - while(p != _connections.end()) - { - if(p->second->isFinished()) - { - _connections.erase(p++); - } - else - { - ++p; - } - } - - // - // Modify endpoints with overrides. - // - vector<EndpointPtr>::iterator q; - for(q = endpoints.begin(); q != endpoints.end(); ++q) - { - if(_instance->defaultsAndOverrides()->overrideTimeout) - { - *q = (*q)->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue); - } - } - - // - // Search for existing connections. - // - vector<EndpointPtr>::const_iterator r; - for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r) - { - pair<multimap<EndpointPtr, ConnectionPtr>::iterator, - multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q); - - while(pr.first != pr.second) - { - // - // Don't return connections for which destruction has - // been initiated. - // - if(!pr.first->second->isDestroyed()) - { - return pr.first->second; - } - - ++pr.first; - } - } - - // - // If some other thread is currently trying to establish a - // connection to any of our endpoints, we wait until this - // thread is finished. - // - bool searchAgain = false; - while(!_destroyed) - { - for(q = endpoints.begin(); q != endpoints.end(); ++q) - { - if(_pending.find(*q) != _pending.end()) - { - break; - } - } - - if(q == endpoints.end()) - { - break; - } - - searchAgain = true; - - wait(); - } - - if(_destroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - // - // Search for existing connections again if we waited above, - // as new connections might have been added in the meantime. - // - if(searchAgain) - { - for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r) - { - pair<multimap<EndpointPtr, ConnectionPtr>::iterator, - multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(*q); - - while(pr.first != pr.second) - { - // - // Don't return connections for which destruction has - // been initiated. - // - if(!pr.first->second->isDestroyed()) - { - return pr.first->second; - } - - ++pr.first; - } - } - } - - // - // No connection to any of our endpoints exists yet, so we - // will try to create one. To avoid that other threads try to - // create connections to the same endpoints, we add our - // endpoints to _pending. - // - _pending.insert(endpoints.begin(), endpoints.end()); - } - - ConnectionPtr connection; - auto_ptr<LocalException> exception; - - vector<EndpointPtr>::const_iterator q; - vector<EndpointPtr>::const_iterator r; - for(q = endpoints.begin(), r = endpts.begin(); q != endpoints.end(); ++q, ++r) - { - EndpointPtr endpoint = *q; - - try - { - ConnectorPtr connector = endpoint->connector(); - assert(connector); - - Int timeout; - if(_instance->defaultsAndOverrides()->overrideConnectTimeout) - { - timeout = _instance->defaultsAndOverrides()->overrideConnectTimeoutValue; - } - // It is not necessary to check for overrideTimeout, - // the endpoint has already been modified with this - // override, if set. - else - { - timeout = endpoint->timeout(); - } - - TransceiverPtr transceiver = connector->connect(timeout); - assert(transceiver); - -#ifdef ICEE_PURE_CLIENT - connection = new Connection(_instance, transceiver, endpoint); -#else - connection = new Connection(_instance, transceiver, endpoint, 0); -#endif - // - // Wait for the connection to be validated by the - // connection thread. Once the connection has been - // validated it will be activated also. - // - connection->waitForValidation(); - break; - } - catch(const LocalException& ex) - { - exception.reset(dynamic_cast<LocalException*>(ex.ice_clone())); - - // - // If a connection object was constructed, then validate() - // must have raised the exception. - // - if(connection) - { - connection->waitUntilFinished(); // We must call waitUntilFinished() for cleanup. - connection = 0; - } - } - - TraceLevelsPtr traceLevels = _instance->traceLevels(); - if(traceLevels->retry >= 2) - { - Trace out(_instance->initializationData().logger, traceLevels->retryCat); - - out << "connection to endpoint failed"; - if(q + 1 != endpoints.end()) - { - out << ", trying next endpoint\n"; - } - else - { - out << " and no more endpoints to try\n"; - } - out << (*exception.get()).toString(); - } - } - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - // - // Signal other threads that we are done with trying to - // establish connections to our endpoints. - // - for(q = endpoints.begin(); q != endpoints.end(); ++q) - { - _pending.erase(*q); - } - notifyAll(); - - if(!connection) - { - assert(exception.get()); - exception->ice_throw(); - } - else - { - _connections.insert(_connections.end(), - pair<const EndpointPtr, ConnectionPtr>(connection->endpoint(), connection)); - - if(_destroyed) - { - connection->destroy(Connection::CommunicatorDestroyed); - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - } - } - - assert(connection); - return connection; -} - -#ifdef ICEE_HAS_ROUTER - -void -IceInternal::OutgoingConnectionFactory::setRouterInfo(const RouterInfoPtr& routerInfo) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_destroyed) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - assert(routerInfo); - // - // Search for connections to the router's client proxy - // endpoints, and update the object adapter for such - // connections, so that callbacks from the router can be - // received over such connections. - // -#ifndef ICEE_PURE_CLIENT - ObjectAdapterPtr adapter = routerInfo->getAdapter(); -#endif - vector<EndpointPtr> endpoints = routerInfo->getClientEndpoints(); - vector<EndpointPtr>::const_iterator p; - for(p = endpoints.begin(); p != endpoints.end(); ++p) - { - EndpointPtr endpoint = *p; - - // - // Modify endpoints with overrides. - // - if(_instance->defaultsAndOverrides()->overrideTimeout) - { - endpoint = endpoint->timeout(_instance->defaultsAndOverrides()->overrideTimeoutValue); - } - -#ifndef ICEE_PURE_CLIENT - pair<multimap<EndpointPtr, ConnectionPtr>::iterator, - multimap<EndpointPtr, ConnectionPtr>::iterator> pr = _connections.equal_range(endpoint); - - while(pr.first != pr.second) - { - try - { - pr.first->second->setAdapter(adapter); - } - catch(const Ice::LocalException&) - { - // - // Ignore, the connection is being closed or closed. - // - } - ++pr.first; - } -#endif - } -} - -#endif - -#ifdef ICEE_HAS_BATCH -void -IceInternal::OutgoingConnectionFactory::flushBatchRequests() -{ - list<ConnectionPtr> c; - - { - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - for(std::multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin(); - p != _connections.end(); - ++p) - { - c.push_back(p->second); - } - } - - for(list<ConnectionPtr>::const_iterator p = c.begin(); p != c.end(); ++p) - { - try - { - (*p)->flushBatchRequests(); - } - catch(const LocalException&) - { - // Ignore. - } - } -} -#endif - -IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const InstancePtr& instance) : - _instance(instance), - _destroyed(false) -{ -} - -IceInternal::OutgoingConnectionFactory::~OutgoingConnectionFactory() -{ - assert(_destroyed); - assert(_connections.empty()); -} - -#ifndef ICEE_PURE_CLIENT - -void -IceInternal::OutgoingConnectionFactory::removeAdapter(const ObjectAdapterPtr& adapter) -{ - IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); - - if(_destroyed) - { - return; - } - - for(multimap<EndpointPtr, ConnectionPtr>::const_iterator p = _connections.begin(); p != _connections.end(); ++p) - { - if(p->second->getAdapter() == adapter) - { - try - { - p->second->setAdapter(0); - } - catch(const Ice::LocalException&) - { - // - // Ignore, the connection is being closed or closed. - // - } - } - } -} - -#endif diff --git a/cppe/src/IceE/OutgoingConnectionFactory.h b/cppe/src/IceE/OutgoingConnectionFactory.h deleted file mode 100644 index f0c9d7c1c16..00000000000 --- a/cppe/src/IceE/OutgoingConnectionFactory.h +++ /dev/null @@ -1,60 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_OUTGOING_CONNECTION_FACTORY_H -#define ICEE_OUTGOING_CONNECTION_FACTORY_H - -#include <IceE/OutgoingConnectionFactoryF.h> -#include <IceE/ConnectionF.h> -#include <IceE/InstanceF.h> -#include <IceE/ObjectAdapterF.h> -#include <IceE/EndpointF.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfoF.h> -#endif -#include <IceE/Shared.h> -#include <IceE/Mutex.h> -#include <IceE/Monitor.h> -#include <set> - -namespace IceInternal -{ - -class OutgoingConnectionFactory : public IceUtil::Shared, public IceUtil::Monitor<IceUtil::Mutex> -{ -public: - - void destroy(); - - void waitUntilFinished(); - - Ice::ConnectionPtr create(const std::vector<EndpointPtr>&); -#ifdef ICEE_HAS_ROUTER - void setRouterInfo(const RouterInfoPtr&); -#endif - void removeAdapter(const ::Ice::ObjectAdapterPtr&); -#ifdef ICEE_HAS_BATCH - void flushBatchRequests(); -#endif - -private: - - OutgoingConnectionFactory(const InstancePtr&); - virtual ~OutgoingConnectionFactory(); - friend class Instance; - - const InstancePtr _instance; - bool _destroyed; - std::multimap<EndpointPtr, Ice::ConnectionPtr> _connections; - std::set<EndpointPtr> _pending; // Endpoints for which connection establishment is pending. -}; - -} - -#endif diff --git a/cppe/src/IceE/Properties.cpp b/cppe/src/IceE/Properties.cpp deleted file mode 100644 index 515323ea477..00000000000 --- a/cppe/src/IceE/Properties.cpp +++ /dev/null @@ -1,396 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/Properties.h> -#include <IceE/StringUtil.h> -#include <IceE/Initialize.h> -#include <IceE/LocalException.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(::Ice::Properties* p) { return p; } - -string -Ice::Properties::getProperty(const string& key) -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, string>::const_iterator p = _properties.find(key); - if(p != _properties.end()) - { - return p->second; - } - else - { - return string(); - } -} - -string -Ice::Properties::getPropertyWithDefault(const string& key, const string& value) -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, string>::const_iterator p = _properties.find(key); - if(p != _properties.end()) - { - return p->second; - } - else - { - return value; - } -} - -Int -Ice::Properties::getPropertyAsInt(const string& key) -{ - return getPropertyAsIntWithDefault(key, 0); -} - -Int -Ice::Properties::getPropertyAsIntWithDefault(const string& key, Int value) -{ - IceUtil::Mutex::Lock sync(*this); - - map<string, string>::const_iterator p = _properties.find(key); - if(p != _properties.end()) - { - value = atoi(p->second.c_str()); - } - - return value; -} - -PropertyDict -Ice::Properties::getPropertiesForPrefix(const string& prefix) -{ - IceUtil::Mutex::Lock sync(*this); - - PropertyDict result; - map<string, string>::const_iterator p; - for(p = _properties.begin(); p != _properties.end(); ++p) - { - if(prefix.empty() || p->first.compare(0, prefix.size(), prefix) == 0) - { - result.insert(*p); - } - } - - return result; -} - -void -Ice::Properties::setProperty(const string& key, const string& value) -{ - if(key.empty()) - { - return; - } - - IceUtil::Mutex::Lock sync(*this); - - // - // Set or clear the property. - // - if(!value.empty()) - { - _properties[key] = value; - } - else - { - _properties.erase(key); - } -} - -StringSeq -Ice::Properties::getCommandLineOptions() -{ - IceUtil::Mutex::Lock sync(*this); - - StringSeq result; - result.reserve(_properties.size()); - map<string, string>::const_iterator p; - for(p = _properties.begin(); p != _properties.end(); ++p) - { - result.push_back("--" + p->first + "=" + p->second); - } - return result; -} - -StringSeq -Ice::Properties::parseCommandLineOptions(const string& prefix, const StringSeq& options) -{ - string pfx = prefix; - if(!pfx.empty() && pfx[pfx.size() - 1] != '.') - { - pfx += '.'; - } - pfx = "--" + pfx; - - StringSeq result; - StringSeq::size_type i; - for(i = 0; i < options.size(); i++) - { - string opt = options[i]; - if(opt.find(pfx) == 0) - { - if(opt.find('=') == string::npos) - { - opt += "=1"; - } - - parseLine(opt.substr(2) -#ifdef ICEE_HAS_WSTRING - , 0 -#endif - ); - } - else - { - result.push_back(opt); - } - } - return result; -} - -StringSeq -Ice::Properties::parseIceCommandLineOptions(const StringSeq& options) -{ - return parseCommandLineOptions("Ice", options); -} - -void -Ice::Properties::load(const std::string& file) -{ - FILE* in = fopen(file.c_str(), "r"); - if(!in) - { - FileException ex(__FILE__, __LINE__); - ex.path = file; - ex.error = getSystemErrno(); - throw ex; - } - - char line[1024]; - while(fgets(line, 1024, in) != NULL) - { - parseLine(line -#ifdef ICEE_HAS_WSTRING - , _converter -#endif - ); - } - fclose(in); -} - -PropertiesPtr -Ice::Properties::clone() -{ - IceUtil::Mutex::Lock sync(*this); - return new Properties(this); -} - -Ice::Properties::Properties(const Properties* p) : - _properties(p->_properties) -#ifdef ICEE_HAS_WSTRING - , _converter(p->_converter) -#endif -{ -} - -Ice::Properties::Properties( -#ifdef ICEE_HAS_WSTRING - const StringConverterPtr& converter) : _converter(converter) -#else - ) -#endif -{ -} - -Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults -#ifdef ICEE_HAS_WSTRING - , const StringConverterPtr& converter) : _converter(converter) -#else - ) -#endif -{ - if(defaults != 0) - { - _properties = defaults->getPropertiesForPrefix(""); - } - - StringSeq::iterator q = args.begin(); - if(q != args.end()) - { - // - // Use the first argument as the value for Ice.ProgramName. Replace - // any backslashes in this value with forward slashes, in case this - // value is used by the event logger. - // - string name = *q; - replace(name.begin(), name.end(), '\\', '/'); - setProperty("Ice.ProgramName", name); - } - StringSeq tmp; - - bool loadConfigFiles = false; - while(q != args.end()) - { - string s = *q; - if(s.find("--Ice.Config") == 0) - { - if(s.find('=') == string::npos) - { - s += "=1"; - } - parseLine(s.substr(2) -#ifdef ICEE_HAS_WSTRING - , 0 -#endif - ); - loadConfigFiles = true; - } - else - { - tmp.push_back(s); - } - ++q; - } - args = tmp; - - if(!loadConfigFiles) - { - // - // If Ice.Config is not set, load from ICE_CONFIG (if set) - // - loadConfigFiles = (_properties.find("Ice.Config") == _properties.end()); - } - - if(loadConfigFiles) - { - loadConfig(); - } - - args = parseIceCommandLineOptions(args); -} - -void -Ice::Properties::parseLine(const string& line -#ifdef ICEE_HAS_WSTRING - , const StringConverterPtr& converter -#endif - ) -{ - string s = line; - - // - // Remove comments and unescape #'s - // - string::size_type idx = 0; - while((idx = s.find("#", idx)) != string::npos) - { - if(idx != 0 && s[idx - 1] == '\\') - { - s.erase(idx - 1, 1); - ++idx; - } - else - { - s.erase(idx); - break; - } - } - - // - // Split key/value and unescape ='s - // - string::size_type split = string::npos; - idx = 0; - while((idx = s.find("=", idx)) != string::npos) - { - if(idx != 0 && s[idx - 1] == '\\') - { - s.erase(idx - 1, 1); - } - else if(split == string::npos) - { - split = idx; - } - ++idx; - } - - if(split == 0 || split == string::npos) - { - return; - } - - string key = IceUtil::trim(s.substr(0, split)); - string value = IceUtil::trim(s.substr(split + 1, s.length() - split - 1)); - -#ifdef ICEE_HAS_WSTRING - if(converter) - { - string tmp; - converter->fromUTF8(reinterpret_cast<const Byte*>(key.data()), - reinterpret_cast<const Byte*>(key.data() + key.size()), tmp); - key.swap(tmp); - - converter->fromUTF8(reinterpret_cast<const Byte*>(value.data()), - reinterpret_cast<const Byte*>(value.data() + value.size()), tmp); - value.swap(tmp); - } -#endif - - setProperty(key, value); -} - -void -Ice::Properties::loadConfig() -{ - string value = getProperty("Ice.Config"); - -#ifndef _WIN32_WCE - if(value.empty() || value == "1") - { - const char* s = getenv("ICE_CONFIG"); - if(s && *s != '\0') - { - value = s; - } - } -#endif - - if(!value.empty()) - { - const string delim = " \t\r\n"; - string::size_type beg = value.find_first_not_of(delim); - while(beg != string::npos) - { - string::size_type end = value.find(",", beg); - string file; - if(end == string::npos) - { - file = value.substr(beg); - beg = end; - } - else - { - file = value.substr(beg, end - beg); - beg = value.find_first_not_of("," + delim, end); - } - load(file); - } - } - - setProperty("Ice.Config", value); -} diff --git a/cppe/src/IceE/Protocol.cpp b/cppe/src/IceE/Protocol.cpp deleted file mode 100644 index d3dc0f0ab43..00000000000 --- a/cppe/src/IceE/Protocol.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Protocol.h> - -namespace IceInternal -{ - -const Ice::Byte magic[] = { 0x49, 0x63, 0x65, 0x50 }; // 'I', 'c', 'e', 'P' - -const Ice::Byte requestHdr[] = -{ - magic[0], - magic[1], - magic[2], - magic[3], - protocolMajor, - protocolMinor, - encodingMajor, - encodingMinor, - requestMsg, - 0, // Compression status - 0, 0, 0, 0, // Message size (placeholder) - 0, 0, 0, 0 // Request id (placeholder) -}; - -const Ice::Byte requestBatchHdr[] = -{ - magic[0], - magic[1], - magic[2], - magic[3], - protocolMajor, - protocolMinor, - encodingMajor, - encodingMinor, - requestBatchMsg, - 0, // Compression status - 0, 0, 0, 0, // Message size (place holder) - 0, 0, 0, 0 // Number of requests in batch (placeholder) -}; - -const Ice::Byte replyHdr[] = -{ - magic[0], - magic[1], - magic[2], - magic[3], - protocolMajor, - protocolMinor, - encodingMajor, - encodingMinor, - replyMsg, - 0, // Compression status - 0, 0, 0, 0 // Message size (placeholder) -}; - -} diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp deleted file mode 100644 index f9f9f4e1cd4..00000000000 --- a/cppe/src/IceE/Proxy.cpp +++ /dev/null @@ -1,852 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Communicator.h> -#include <IceE/Proxy.h> -#include <IceE/ProxyFactory.h> -#include <IceE/Outgoing.h> -#include <IceE/Connection.h> -#include <IceE/Reference.h> -#include <IceE/Instance.h> -#include <IceE/BasicStream.h> -#include <IceE/LocalException.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfo.h> -# include <IceE/Router.h> -#endif -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfo.h> -# include <IceE/Locator.h> -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -void -Ice::__write(::IceInternal::BasicStream* __os, const ::Ice::Context& v, ::Ice::__U__Context) -{ - __os->writeSize(::Ice::Int(v.size())); - ::Ice::Context::const_iterator p; - for(p = v.begin(); p != v.end(); ++p) - { - __os->write(p->first); - __os->write(p->second); - } -} - -void -Ice::__read(::IceInternal::BasicStream* __is, ::Ice::Context& v, ::Ice::__U__Context) -{ - ::Ice::Int sz; - __is->readSize(sz); - while(sz--) - { - ::std::pair<const ::std::string, ::std::string> pair; - __is->read(const_cast< ::std::string&>(pair.first)); - ::Ice::Context::iterator __i = v.insert(v.end(), pair); - __is->read(__i->second); - } -} - -::Ice::ObjectPrx -IceInternal::checkedCastImpl(const ObjectPrx& b, const string& f, const string& typeId) -{ -// -// COMPILERBUG: Without this work-around, release VC7.0 and VC7.1 -// build crash when FacetNotExistException is raised -// -#if defined(_MSC_VER) && (_MSC_VER >= 1300) && (_MSC_VER <= 1310) - ObjectPrx fooBar; -#endif - - if(b) - { - ObjectPrx bb = b->ice_facet(f); - try - { - if(bb->ice_isA(typeId)) - { - return bb; - } -#ifndef NDEBUG - else - { - assert(typeId != "::Ice::Object"); - } -#endif - } - catch(const FacetNotExistException&) - { - } - } - return 0; -} - -::Ice::ObjectPrx -IceInternal::checkedCastImpl(const ObjectPrx& b, const string& f, const string& typeId, const Context& ctx) -{ -// -// COMPILERBUG: Without this work-around, release VC7.0 build crash -// when FacetNotExistException is raised -// -#if defined(_MSC_VER) && (_MSC_VER == 1300) - ObjectPrx fooBar; -#endif - - if(b) - { - ObjectPrx bb = b->ice_facet(f); - try - { - if(bb->ice_isA(typeId, ctx)) - { - return bb; - } -#ifndef NDEBUG - else - { - assert(typeId != "::Ice::Object"); - } -#endif - } - catch(const FacetNotExistException&) - { - } - } - return 0; -} - -bool -IceProxy::Ice::Object::operator==(const Object& r) const -{ - return _reference == r._reference; -} - -bool -IceProxy::Ice::Object::operator<(const Object& r) const -{ - return _reference < r._reference; -} - -Int -IceProxy::Ice::Object::ice_getHash() const -{ - return _reference->hash(); -} - -CommunicatorPtr -IceProxy::Ice::Object::ice_getCommunicator() const -{ - return _reference->getCommunicator(); -} - -string -IceProxy::Ice::Object::ice_toString() const -{ - return _reference->toString(); -} - -bool -IceProxy::Ice::Object::ice_isA(const string& __id, const Context* __context) -{ - int __cnt = 0; - while(true) - { - ConnectionPtr __connection; - try - { - __checkTwowayOnly("ice_isA"); - static const string __operation("ice_isA"); - __connection = ice_getConnection(); - Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context); - BasicStream* __stream = __og.stream(); - try - { - __stream->write(__id, false); - } - catch(const ::Ice::LocalException& __ex) - { - __og.abort(__ex); - } - bool __ret; - bool __ok = __og.invoke(); - try - { - if(!__ok) - { - try - { - __stream->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - __stream->read(__ret); - } - catch(const ::Ice::LocalException& __ex) - { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - return __ret; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__connection, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__connection, __ex, __cnt); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - } -} - -void -IceProxy::Ice::Object::ice_ping(const Context* __context) -{ - int __cnt = 0; - while(true) - { - ConnectionPtr __connection; - try - { - static const string __operation("ice_ping"); - __connection = ice_getConnection(); - Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context); - bool __ok = __og.invoke(); - try - { - BasicStream* __is = __og.stream(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - } - catch(const ::Ice::LocalException& __ex) - { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - return; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__connection, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__connection, __ex, __cnt); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - } -} - -vector<string> -IceProxy::Ice::Object::ice_ids(const Context* __context) -{ - int __cnt = 0; - while(true) - { - ConnectionPtr __connection; - try - { - __checkTwowayOnly("ice_ids"); - static const string __operation("ice_ids"); - __connection = ice_getConnection(); - Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context); - vector<string> __ret; - bool __ok = __og.invoke(); - try - { - BasicStream* __is = __og.stream(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - __is->read(__ret, false); - } - catch(const ::Ice::LocalException& __ex) - { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - return __ret; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__connection, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__connection, __ex, __cnt); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - } -} - -string -IceProxy::Ice::Object::ice_id(const Context* __context) -{ - int __cnt = 0; - while(true) - { - ConnectionPtr __connection; - try - { - __checkTwowayOnly("ice_id"); - static const string __operation("ice_id"); - __connection = ice_getConnection(); - Outgoing __og(__connection.get(), _reference.get(), __operation, ::Ice::Nonmutating, __context); - string __ret; - bool __ok = __og.invoke(); - try - { - BasicStream* __is = __og.stream(); - if(!__ok) - { - try - { - __is->throwException(); - } - catch(const ::Ice::UserException& __ex) - { - throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); - } - } - __is->read(__ret, false); - } - catch(const ::Ice::LocalException& __ex) - { - throw ::IceInternal::LocalExceptionWrapper(__ex, false); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - return __ret; - } - catch(const LocalExceptionWrapper& __ex) - { - __handleExceptionWrapperRelaxed(__connection, __ex, __cnt); - } - catch(const LocalException& __ex) - { - __handleException(__connection, __ex, __cnt); - } -#if defined(_MSC_VER) && defined(_M_ARM) // ARM bug. - catch(...) - { - throw; - } -#endif - } -} - -Context -IceProxy::Ice::Object::ice_getContext() const -{ - return *_reference->getContext(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_context(const Context& newContext) const -{ - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeContext(newContext)); - return proxy; -} - -Identity -IceProxy::Ice::Object::ice_getIdentity() const -{ - return _reference->getIdentity(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_identity(const Identity& newIdentity) const -{ - if(newIdentity.name.empty()) - { - throw IllegalIdentityException(__FILE__, __LINE__); - } - if(newIdentity == _reference->getIdentity()) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeIdentity(newIdentity)); - return proxy; - } -} - -const string& -IceProxy::Ice::Object::ice_getFacet() const -{ - return _reference->getFacet(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_facet(const string& newFacet) const -{ - if(newFacet == _reference->getFacet()) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeFacet(newFacet)); - return proxy; - } -} - -#ifdef ICEE_HAS_ROUTER - -RouterPrx -IceProxy::Ice::Object::ice_getRouter() const -{ - RouterInfoPtr ri = _reference->getRouterInfo(); - return ri ? ri->getRouter() : RouterPrx(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_router(const RouterPrx& router) const -{ - ReferencePtr ref = _reference->changeRouter(router); - if(ref == _reference) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; - } -} - -#endif - -#ifdef ICEE_HAS_LOCATOR - -string -IceProxy::Ice::Object::ice_getAdapterId() const -{ - return _reference->getAdapterId(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_adapterId(const string& adapterId) const -{ - ReferencePtr ref = _reference->changeAdapterId(adapterId); - if(ref == _reference) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; - } -} - -LocatorPrx -IceProxy::Ice::Object::ice_getLocator() const -{ - LocatorInfoPtr ri = _reference->getLocatorInfo(); - return ri ? ri->getLocator() : LocatorPrx(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_locator(const LocatorPrx& locator) const -{ - ReferencePtr ref = _reference->changeLocator(locator); - if(ref == _reference) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; - } -} - -#endif - -bool -IceProxy::Ice::Object::ice_isSecure() const -{ - return _reference->getSecure(); -} - -ObjectPrx -IceProxy::Ice::Object::ice_secure(bool b) const -{ - if(b == _reference->getSecure()) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeSecure(b)); - return proxy; - } -} - -ObjectPrx -IceProxy::Ice::Object::ice_timeout(int t) const -{ - ReferencePtr ref = _reference->changeTimeout(t); - if(ref == _reference) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(ref); - return proxy; - } -} - -ConnectionPtr -IceProxy::Ice::Object::ice_getConnection() -{ - ::IceUtil::Mutex::Lock sync(*this); - - if(!_connection) - { - _connection = _reference->getConnection(); - - // - // If this proxy is for a non-local object, and we are - // using a router, then add this proxy to the router info - // object. - // -#ifdef ICEE_HAS_ROUTER - RouterInfoPtr ri = _reference->getRouterInfo(); - if(ri) - { - ri->addProxy(this); - } -#endif - } - return _connection; -} - -ConnectionPtr -IceProxy::Ice::Object::ice_getCachedConnection() const -{ - ::IceUtil::Mutex::Lock sync(*this); - return _connection; -} - -void -IceProxy::Ice::Object::__copyFrom(const ObjectPrx& from) -{ - ReferencePtr ref; - ConnectionPtr con; - - { - ::IceUtil::Mutex::Lock sync(*from.get()); - - ref = from->_reference; - con = from->_connection; - } - - // - // No need to synchronize "*this", as this operation is only - // called upon initialization. - // - - assert(!_reference); - assert(!_connection); - - _reference = ref; - _connection = con; -} - -void -IceProxy::Ice::Object::__handleException(const ConnectionPtr& connection, const LocalException& ex, int& cnt) -{ - // - // Only _connection needs to be mutex protected here. - // - { - ::IceUtil::Mutex::Lock sync(*this); - if(connection.get() == _connection.get()) - { - _connection = 0; - } - } - - ProxyFactoryPtr proxyFactory = _reference->getInstance()->proxyFactory(); - if(proxyFactory) - { - proxyFactory->checkRetryAfterException(ex, _reference, cnt); - } - else - { - // - // The communicator is already destroyed, so we cannot retry. - // - ex.ice_throw(); - } -} - -void -IceProxy::Ice::Object::__handleExceptionWrapper(const ConnectionPtr& connection, const LocalExceptionWrapper& ex) -{ - { - IceUtil::Mutex::Lock sync(*this); - if(connection.get() == _connection.get()) - { - _connection = 0; - } - } - - if(!ex.retry()) - { - ex.get()->ice_throw(); - } -} - -void -IceProxy::Ice::Object::__handleExceptionWrapperRelaxed(const ConnectionPtr& connection, - const LocalExceptionWrapper& ex, - int& cnt) -{ - if(!ex.retry()) - { - __handleException(connection, *ex.get(), cnt); - } - else - { - IceUtil::Mutex::Lock sync(*this); - if(connection.get() == _connection.get()) - { - _connection = 0; - } - } -} - -void -IceProxy::Ice::Object::__checkTwowayOnly(const char* name) const -{ - // - // No mutex lock necessary, there is nothing mutable in this - // operation. - // - - if(!ice_isTwoway()) - { - TwowayOnlyException ex(__FILE__, __LINE__); - ex.operation = name; - throw ex; - } -} - -ReferenceMode -IceProxy::Ice::Object::getMode() const -{ - return _reference->getMode(); -} - -ObjectPrx -IceProxy::Ice::Object::changeMode(ReferenceMode newMode) const -{ - if(_reference->getMode() == newMode) - { - return ObjectPrx(const_cast< ::IceProxy::Ice::Object*>(this)); - } - else - { - ObjectPrx proxy(new ::IceProxy::Ice::Object()); - proxy->setup(_reference->changeMode(newMode)); - return proxy; - } -} - -bool -Ice::proxyIdentityLess(const ObjectPrx& lhs, const ObjectPrx& rhs) -{ - if(!lhs && !rhs) - { - return false; - } - else if(!lhs && rhs) - { - return true; - } - else if(lhs && !rhs) - { - return false; - } - else - { - return lhs->ice_getIdentity() < rhs->ice_getIdentity(); - } -} - -bool -Ice::proxyIdentityEqual(const ObjectPrx& lhs, const ObjectPrx& rhs) -{ - if(!lhs && !rhs) - { - return true; - } - else if(!lhs && rhs) - { - return false; - } - else if(lhs && !rhs) - { - return false; - } - else - { - return lhs->ice_getIdentity() == rhs->ice_getIdentity(); - } -} - -bool -Ice::proxyIdentityAndFacetLess(const ObjectPrx& lhs, const ObjectPrx& rhs) -{ - if(!lhs && !rhs) - { - return false; - } - else if(!lhs && rhs) - { - return true; - } - else if(lhs && !rhs) - { - return false; - } - else - { - Identity lhsIdentity = lhs->ice_getIdentity(); - Identity rhsIdentity = rhs->ice_getIdentity(); - - if(lhsIdentity < rhsIdentity) - { - return true; - } - else if(rhsIdentity < lhsIdentity) - { - return false; - } - - string lhsFacet = lhs->ice_getFacet(); - string rhsFacet = rhs->ice_getFacet(); - - if(lhsFacet < rhsFacet) - { - return true; - } - else if(rhsFacet < lhsFacet) - { - return false; - } - - return false; - } -} - -bool -Ice::proxyIdentityAndFacetEqual(const ObjectPrx& lhs, const ObjectPrx& rhs) -{ - if(!lhs && !rhs) - { - return true; - } - else if(!lhs && rhs) - { - return false; - } - else if(lhs && !rhs) - { - return false; - } - else - { - Identity lhsIdentity = lhs->ice_getIdentity(); - Identity rhsIdentity = rhs->ice_getIdentity(); - - if(lhsIdentity == rhsIdentity) - { - string lhsFacet = lhs->ice_getFacet(); - string rhsFacet = rhs->ice_getFacet(); - - if(lhsFacet == rhsFacet) - { - return true; - } - } - - return false; - } -} diff --git a/cppe/src/IceE/ProxyFactory.cpp b/cppe/src/IceE/ProxyFactory.cpp deleted file mode 100644 index 49606d69074..00000000000 --- a/cppe/src/IceE/ProxyFactory.cpp +++ /dev/null @@ -1,268 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ProxyFactory.h> -#include <IceE/Thread.h> -#include <IceE/Time.h> -#include <IceE/Instance.h> -#include <IceE/Proxy.h> -#include <IceE/Reference.h> -#include <IceE/ReferenceFactory.h> -#include <IceE/LocatorInfo.h> -#include <IceE/Properties.h> -#include <IceE/LoggerUtil.h> -#include <IceE/TraceLevels.h> -#include <IceE/LocalException.h> -#include <IceE/SafeStdio.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(ProxyFactory* p) { return p; } - -ObjectPrx -IceInternal::ProxyFactory::stringToProxy(const string& str) const -{ - ReferencePtr ref = _instance->referenceFactory()->create(str); - return referenceToProxy(ref); -} - -string -IceInternal::ProxyFactory::proxyToString(const ObjectPrx& proxy) const -{ - if(proxy) - { - return proxy->__reference()->toString(); - } - else - { - return ""; - } -} - -ObjectPrx -IceInternal::ProxyFactory::propertyToProxy(const string& prefix) const -{ - ReferencePtr ref = _instance->referenceFactory()->createFromProperties(prefix); - return referenceToProxy(ref); -} - -ObjectPrx -IceInternal::ProxyFactory::streamToProxy(BasicStream* s) const -{ - Identity ident; - ident.__read(s); - - ReferencePtr ref = _instance->referenceFactory()->create(ident, s); - return referenceToProxy(ref); -} - -void -IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, BasicStream* s) const -{ - if(proxy) - { - proxy->__reference()->getIdentity().__write(s); - proxy->__reference()->streamWrite(s); - } - else - { - Identity ident; - ident.__write(s); - } -} - -ObjectPrx -IceInternal::ProxyFactory::referenceToProxy(const ReferencePtr& ref) const -{ - if(ref) - { - ObjectPrx proxy = new ::IceProxy::Ice::Object; - proxy->setup(ref); - return proxy; - } - else - { - return 0; - } -} - -void -IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, const ReferencePtr& ref, int& cnt) const -{ - TraceLevelsPtr traceLevels = _instance->traceLevels(); - LoggerPtr logger = _instance->initializationData().logger; - -#if defined(ICEE_HAS_LOCATOR) || defined(ICEE_HAS_ROUTER) - const ObjectNotExistException* one = dynamic_cast<const ObjectNotExistException*>(&ex); - if(one) - { -#ifdef ICEE_HAS_LOCATOR - LocatorInfoPtr li = ref->getLocatorInfo(); - if(li) - { - // - // We retry ObjectNotExistException if the reference is indirect. - // - li->clearObjectCache(IndirectReferencePtr::dynamicCast(ref)); - } - else -#endif -#ifdef ICEE_HAS_ROUTER - if(ref->getRouterInfo() && one->operation == "ice_add_proxy") - { - // - // If we have a router, an ObjectNotExistException with an - // operation name "ice_add_proxy" indicates to the client - // that the router isn't aware of the proxy (for example, - // because it was evicted by the router). In this case, we - // must *always* retry, so that the missing proxy is added - // to the router. - // - if(traceLevels->retry >= 1) - { - Trace out(logger, traceLevels->retryCat); - out << "retrying operation call to add proxy to router\n" << ex.toString(); - } - return; // We must always retry, so we don't look at the retry count. - } - else -#endif - { - // - // For all other cases, we don't retry ObjectNotExistException - // - ex.ice_throw(); - } - } - else -#endif - if(dynamic_cast<const RequestFailedException*>(&ex)) - { - // - // We don't retry other *NotExistException, which are all - // derived from RequestFailedException. - // - ex.ice_throw(); - } - - // - // There is no point in retrying an operation that resulted in a - // MarshalException. This must have been raised locally (because - // if it happened in a server it would result in an - // UnknownLocalException instead), which means there was a problem - // in this process that will not change if we try again. - // - // The most likely cause for a MarshalException is exceeding the - // maximum message size, which is represented by the the subclass - // MemoryLimitException. For example, a client can attempt to send - // a message that exceeds the maximum memory size, or accumulate - // enough batch requests without flushing that the maximum size is - // reached. - // - // This latter case is especially problematic, because if we were - // to retry a batch request after a MarshalException, we would in - // fact silently discard the accumulated requests and allow new - // batch requests to accumulate. If the subsequent batched - // requests do not exceed the maximum message size, it appears to - // the client that all of the batched requests were accepted, when - // in reality only the last few are actually sent. - // - if(dynamic_cast<const MarshalException*>(&ex)) - { - ex.ice_throw(); - } - - ++cnt; - assert(cnt > 0); - - if(cnt > static_cast<int>(_retryIntervals.size())) - { - if(traceLevels->retry >= 1) - { - Trace out(logger, traceLevels->retryCat); - out << "cannot retry operation call because retry limit has been exceeded\n" << ex.toString(); - } - ex.ice_throw(); - } - - int interval = _retryIntervals[cnt - 1]; - - if(traceLevels->retry >= 1) - { - Trace out(logger, traceLevels->retryCat); - out << "retrying operation call"; - if(interval > 0) - { - out << Ice::printfToString(" in %dms", interval); - } - out << " because of exception\n" << ex.toString(); - } - - if(interval > 0) - { - // - // Sleep before retrying. - // - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); - } -} - -IceInternal::ProxyFactory::ProxyFactory(const InstancePtr& instance) : - _instance(instance) -{ - string str = _instance->initializationData().properties->getPropertyWithDefault("Ice.RetryIntervals", "0"); - - string::size_type beg; - string::size_type end = 0; - - while(true) - { - const string delim = " \t"; - - beg = str.find_first_not_of(delim, end); - if(beg == string::npos) - { - if(_retryIntervals.empty()) - { - _retryIntervals.push_back(0); - } - break; - } - - end = str.find_first_of(delim, beg); - if(end == string::npos) - { - end = str.length(); - } - - if(beg == end) - { - break; - } - - string value = str.substr(beg, end - beg); - int v = atoi(value.c_str()); - - // - // If -1 is the first value, no retry and wait intervals. - // - if(v == -1 && _retryIntervals.empty()) - { - break; - } - - _retryIntervals.push_back(v > 0 ? v : 0); - } -} - -IceInternal::ProxyFactory::~ProxyFactory() -{ -} diff --git a/cppe/src/IceE/ProxyFactory.h b/cppe/src/IceE/ProxyFactory.h deleted file mode 100644 index c6af5e1bab3..00000000000 --- a/cppe/src/IceE/ProxyFactory.h +++ /dev/null @@ -1,59 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_PROXY_FACTORY_H -#define ICEE_PROXY_FACTORY_H - -#include <IceE/ProxyFactoryF.h> -#include <IceE/InstanceF.h> -#include <IceE/ReferenceF.h> -#include <IceE/ProxyF.h> -#include <IceE/Shared.h> - -namespace Ice -{ - -class LocalException; - -} - -namespace IceInternal -{ - -class BasicStream; - -class ProxyFactory : public IceUtil::Shared -{ -public: - - Ice::ObjectPrx stringToProxy(const std::string&) const; - std::string proxyToString(const Ice::ObjectPrx&) const; - - Ice::ObjectPrx propertyToProxy(const std::string&) const; - - Ice::ObjectPrx streamToProxy(BasicStream*) const; - void proxyToStream(const Ice::ObjectPrx&, BasicStream*) const; - - Ice::ObjectPrx referenceToProxy(const ReferencePtr&) const; - - void checkRetryAfterException(const Ice::LocalException&, const ReferencePtr&, int&) const; - -private: - - ProxyFactory(const InstancePtr&); - virtual ~ProxyFactory(); - friend class Instance; - - InstancePtr _instance; - std::vector<int> _retryIntervals; -}; - -} - -#endif diff --git a/cppe/src/IceE/RecMutex.cpp b/cppe/src/IceE/RecMutex.cpp deleted file mode 100644 index 435509207d6..00000000000 --- a/cppe/src/IceE/RecMutex.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/RecMutex.h> -#include <IceE/Exception.h> - -using namespace std; - -#ifdef _WIN32 - -# if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0400 - -IceUtil::RecMutex::RecMutex() : - _count(0) -{ - InitializeCriticalSection(&_mutex); -} - -IceUtil::RecMutex::~RecMutex() -{ - assert(_count == 0); - DeleteCriticalSection(&_mutex); -} - -void -IceUtil::RecMutex::lock() const -{ - EnterCriticalSection(&_mutex); - if(++_count > 1) - { - LeaveCriticalSection(&_mutex); - } -} - -bool -IceUtil::RecMutex::tryLock() const -{ - if(!TryEnterCriticalSection(&_mutex)) - { - return false; - } - if(++_count > 1) - { - LeaveCriticalSection(&_mutex); - } - return true; -} - -void -IceUtil::RecMutex::unlock() const -{ - if(--_count == 0) - { - LeaveCriticalSection(&_mutex); - } -} - -void -IceUtil::RecMutex::unlock(LockState& state) const -{ - state.count = _count; - _count = 0; - LeaveCriticalSection(&_mutex); -} - -void -IceUtil::RecMutex::lock(LockState& state) const -{ - EnterCriticalSection(&_mutex); - _count = state.count; -} - -# else - -IceUtil::RecMutex::RecMutex() : - _count(0) -{ - _mutex = CreateMutex(0, false, 0); - if(_mutex == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -IceUtil::RecMutex::~RecMutex() -{ - assert(_count == 0); - BOOL rc = CloseHandle(_mutex); - if(rc == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -void -IceUtil::RecMutex::lock() const -{ - DWORD rc = WaitForSingleObject(_mutex, INFINITE); - if(rc != WAIT_OBJECT_0) - { - if(rc == WAIT_FAILED) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, 0); - } - } - - if(++_count > 1) - { - BOOL rc2 = ReleaseMutex(_mutex); - if(rc2 == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - } -} - -bool -IceUtil::RecMutex::tryLock() const -{ - DWORD rc = WaitForSingleObject(_mutex, 0); - if(rc != WAIT_OBJECT_0) - { - return false; - } - if(++_count > 1) - { - BOOL rc2 = ReleaseMutex(_mutex); - if(rc2 == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - } - return true; -} - -void -IceUtil::RecMutex::unlock() const -{ - if(--_count == 0) - { - BOOL rc = ReleaseMutex(_mutex); - if(rc == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - } -} - -void -IceUtil::RecMutex::unlock(LockState& state) const -{ - state.count = _count; - _count = 0; - BOOL rc = ReleaseMutex(_mutex); - if(rc == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -void -IceUtil::RecMutex::lock(LockState& state) const -{ - DWORD rc = WaitForSingleObject(_mutex, INFINITE); - if(rc != WAIT_OBJECT_0) - { - if(rc == WAIT_FAILED) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - else - { - throw ThreadSyscallException(__FILE__, __LINE__, 0); - } - } - - _count = state.count; -} - -# endif - -#else - -IceUtil::RecMutex::RecMutex() : - _count(0) -{ - int rc; - -#if defined(__linux) && !defined(__USE_UNIX98) - const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE_NP }; -#else - pthread_mutexattr_t attr; - rc = pthread_mutexattr_init(&attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -#endif - - rc = pthread_mutex_init(&_mutex, &attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - -#if defined(__linux) && !defined(__USE_UNIX98) -// Nothing to do -#else - rc = pthread_mutexattr_destroy(&attr); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -#endif -} - -IceUtil::RecMutex::~RecMutex() -{ - assert(_count == 0); - int rc = 0; - rc = pthread_mutex_destroy(&_mutex); - assert(rc == 0); -} - -void -IceUtil::RecMutex::lock() const -{ - int rc = pthread_mutex_lock(&_mutex); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - if(++_count > 1) - { - rc = pthread_mutex_unlock(&_mutex); - assert(rc == 0); - } -} - -bool -IceUtil::RecMutex::tryLock() const -{ - int rc = pthread_mutex_trylock(&_mutex); - bool result = (rc == 0); - if(!result) - { - if(rc != EBUSY) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - } - else if(++_count > 1) - { - rc = pthread_mutex_unlock(&_mutex); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - } - return result; -} - -void -IceUtil::RecMutex::unlock() const -{ - if(--_count == 0) - { - int rc = 0; // Prevent warnings when NDEBUG is defined. - rc = pthread_mutex_unlock(&_mutex); - assert(rc == 0); - } -} - -void -IceUtil::RecMutex::unlock(LockState& state) const -{ - state.mutex = &_mutex; - state.count = _count; - _count = 0; -} - -void -IceUtil::RecMutex::lock(LockState& state) const -{ - _count = state.count; -} - -#endif - -bool -IceUtil::RecMutex::willUnlock() const -{ - return _count == 1; -} diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp deleted file mode 100644 index 16319eab04a..00000000000 --- a/cppe/src/IceE/Reference.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Reference.h> -#include <IceE/ReferenceFactory.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/Endpoint.h> -#include <IceE/BasicStream.h> - -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfo.h> -# include <IceE/Router.h> -#endif - -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfo.h> -# include <IceE/Locator.h> -#endif - -#include <IceE/Connection.h> -#include <IceE/Functional.h> -#include <IceE/OutgoingConnectionFactory.h> -#include <IceE/LoggerUtil.h> -#include <IceE/TraceLevels.h> -#include <IceE/StringUtil.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(IceInternal::Reference* p) { return p; } - -class ConnectionIsDatagram : public unary_function<ConnectionPtr, bool> -{ -public: - - bool - operator()(ConnectionPtr p) const - { - return p->endpoint()->datagram(); - } -}; - -class ConnectionIsSecure : public unary_function<ConnectionPtr, bool> -{ -public: - - bool - operator()(ConnectionPtr p) const - { - return p->endpoint()->secure(); - } -}; - -CommunicatorPtr -IceInternal::Reference::getCommunicator() const -{ - return _communicator; -} - -ReferencePtr -IceInternal::Reference::changeContext(const Context& newContext) const -{ - ReferencePtr r = _instance->referenceFactory()->copy(this); - r->_context = newContext; - return r; -} - -ReferencePtr -IceInternal::Reference::changeMode(ReferenceMode newMode) const -{ - if(newMode == _mode) - { - return ReferencePtr(const_cast<Reference*>(this)); - } - ReferencePtr r = _instance->referenceFactory()->copy(this); - r->_mode = newMode; - return r; -} - -ReferencePtr -IceInternal::Reference::changeSecure(bool newSecure) const -{ - if(newSecure == _secure) - { - return ReferencePtr(const_cast<Reference*>(this)); - } - ReferencePtr r = _instance->referenceFactory()->copy(this); - r->_secure = newSecure; - return r; -} - -ReferencePtr -IceInternal::Reference::changeIdentity(const Identity& newIdentity) const -{ - if(newIdentity == _identity) - { - return ReferencePtr(const_cast<Reference*>(this)); - } - ReferencePtr r = _instance->referenceFactory()->copy(this); - r->_identity = newIdentity; - return r; -} - -ReferencePtr -IceInternal::Reference::changeFacet(const string& newFacet) const -{ - if(newFacet == _facet) - { - return ReferencePtr(const_cast<Reference*>(this)); - } - ReferencePtr r = _instance->referenceFactory()->copy(this); - r->_facet = newFacet; - return r; -} - -ReferencePtr -IceInternal::Reference::changeTimeout(int newTimeout) const -{ - if(_overrideTimeout && newTimeout == _timeout) - { - return ReferencePtr(const_cast<Reference*>(this)); - } - ReferencePtr r = getInstance()->referenceFactory()->copy(this); - r->_timeout = newTimeout; - r->_overrideTimeout = true; - return r; -} - -Int -Reference::hash() const -{ - IceUtil::RecMutex::Lock sync(_hashMutex); - - if(_hashInitialized) - { - return _hashValue; - } - - string::const_iterator p; - Context::const_iterator q; - - Int h = static_cast<Int>(_mode); - - for(p = _identity.name.begin(); p != _identity.name.end(); ++p) - { - h = 5 * h + *p; - } - - for(p = _identity.category.begin(); p != _identity.category.end(); ++p) - { - h = 5 * h + *p; - } - - for(q = _context.begin(); q != _context.end(); ++q) - { - for(p = q->first.begin(); p != q->first.end(); ++p) - { - h = 5 * h + *p; - } - for(p = q->second.begin(); p != q->second.end(); ++p) - { - h = 5 * h + *p; - } - } - - for(p = _facet.begin(); p != _facet.end(); ++p) - { - h = 5 * h + *p; - } - - h = 5 * h + static_cast<Int>(getSecure()); - - _hashValue = h; - _hashInitialized = true; - - return h; -} - -void -IceInternal::Reference::streamWrite(BasicStream* s) const -{ - // - // Don't write the identity here. Operations calling streamWrite - // write the identity. - // - - // - // For compatibility with the old FacetPath. - // - if(_facet.empty()) - { - s->write(static_cast<string*>(0), static_cast<string*>(0)); - } - else - { - s->write(&_facet, &_facet + 1); - } - - s->write(static_cast<Byte>(_mode)); - - s->write(getSecure()); - - // Derived class writes the remainder of the reference. -} - -string -IceInternal::Reference::toString() const -{ - string s; - - // - // If the encoded identity string contains characters which - // the reference parser uses as separators, then we enclose - // the identity string in quotes. - // - string id = _instance->identityToString(_identity); - if(id.find_first_of(" :@") != string::npos) - { - s += "\""; - s += id; - s += "\""; - } - else - { - s += id; - } - - if(!_facet.empty()) - { - s += " -f "; - - // - // If the encoded facet string contains characters which - // the reference parser uses as separators, then we enclose - // the facet string in quotes. - // - string fs = _facet; -#ifdef ICEE_HAS_WSTRING - if(_instance->initializationData().stringConverter) - { - UTF8BufferI buffer; - Byte* last = - _instance->initializationData().stringConverter->toUTF8(fs.data(), fs.data() + fs.size(), buffer); - fs = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } -#endif - fs = IceUtil::escapeString(fs, ""); - if(fs.find_first_of(" :@") != string::npos) - { - s += "\""; - s += fs; - s += "\""; - } - else - { - s += fs; - } - } - - switch(_mode) - { - case ReferenceModeTwoway: - { - s += " -t"; - break; - } - - case ReferenceModeOneway: - { - s += " -o"; - break; - } - - case ReferenceModeBatchOneway: - { - s += " -O"; - break; - } - - case ReferenceModeDatagram: - { - s += " -d"; - break; - } - - case ReferenceModeBatchDatagram: - { - s += " -D"; - break; - } - } - - if(getSecure()) - { - s += " -s"; - } - - return s; - - // Derived class writes the remainder of the string. -} - -bool -IceInternal::Reference::operator==(const Reference& r) const -{ - // - // Note: if(this == &r) test is performed by each non-abstract derived class. - // - - if(getType() != r.getType()) - { - return false; - } - - if(_mode != r._mode) - { - return false; - } - - if(_secure != r._secure) - { - return false; - } - - if(_identity != r._identity) - { - return false; - } - - if(_context != r._context) - { - return false; - } - - if(_facet != r._facet) - { - return false; - } - - if(_overrideTimeout != r._overrideTimeout || _overrideTimeout && _timeout != r._timeout) - { - return false; - } - - return true; -} - -bool -IceInternal::Reference::operator<(const Reference& r) const -{ - // - // Note: if(this == &r) test is performed by each non-abstract derived class. - // - - if(_mode < r._mode) - { - return true; - } - else if(r._mode < _mode) - { - return false; - } - - if(!_secure && r._secure) - { - return true; - } - else if(r._secure < _secure) - { - return false; - } - - if(_identity < r._identity) - { - return true; - } - else if(r._identity < _identity) - { - return false; - } - - if(_context < r._context) - { - return true; - } - else if(r._context < _context) - { - return false; - } - - if(_facet < r._facet) - { - return true; - } - else if(r._facet < _facet) - { - return false; - } - - if(!_overrideTimeout && r._overrideTimeout) - { - return true; - } - else if(r._overrideTimeout < _overrideTimeout) - { - return false; - } - else if(_overrideTimeout) - { - if(_timeout < r._timeout) - { - return true; - } - else if(r._timeout < _timeout) - { - return false; - } - } - - if(getType() < r.getType()) - { - return true; - } - else if(r.getType() < getType()) - { - return false; - } - - return false; -} - -IceInternal::Reference::Reference(const InstancePtr& inst, const CommunicatorPtr& com, const Identity& ident, - const Context& context, const string& fs, ReferenceMode md, bool sec) : - _hashInitialized(false), - _instance(inst), - _communicator(com), - _mode(md), - _secure(sec), - _identity(ident), - _context(context), - _facet(fs), - _overrideTimeout(false), - _timeout(-1) -{ -} - -IceInternal::Reference::Reference(const Reference& r) : - _hashInitialized(false), - _instance(r._instance), - _communicator(r._communicator), - _mode(r._mode), - _secure(r._secure), - _identity(r._identity), - _context(r._context), - _facet(r._facet), - _overrideTimeout(r._overrideTimeout), - _timeout(r._timeout) -{ -} - -void -IceInternal::Reference::applyOverrides(vector<EndpointPtr>& endpts) const -{ - // - // Apply the endpoint overrides to each endpoint. - // - for(vector<EndpointPtr>::iterator p = endpts.begin(); p != endpts.end(); ++p) - { - if(_overrideTimeout) - { - *p = (*p)->timeout(_timeout); - } - } -} - -IceUtil::Shared* IceInternal::upCast(IceInternal::FixedReference* p) { return p; } - -IceInternal::FixedReference::FixedReference(const InstancePtr& inst, const CommunicatorPtr& com, const Identity& ident, - const Context& context, const string& fs, ReferenceMode md, - const vector<ConnectionPtr>& fixedConns) : - Reference(inst, com, ident, context, fs, md, false), - _fixedConnections(fixedConns) -{ -} - -Reference::Type -IceInternal::FixedReference::getType() const -{ - return TypeFixed; -} - -vector<EndpointPtr> -IceInternal::FixedReference::getEndpoints() const -{ - return vector<EndpointPtr>(); -} - -#ifdef ICEE_HAS_ROUTER - -ReferencePtr -IceInternal::FixedReference::changeRouter(const RouterPrx&) const -{ - throw FixedProxyException(__FILE__, __LINE__); - return 0; // Keep the compiler happy. -} - -#endif - -#ifdef ICEE_HAS_LOCATOR - -string -IceInternal::FixedReference::getAdapterId() const -{ - return string(); -} - -ReferencePtr -IceInternal::FixedReference::changeAdapterId(const std::string&) const -{ - throw FixedProxyException(__FILE__, __LINE__); - return 0; // Keep the compiler happy. -} - -ReferencePtr -IceInternal::FixedReference::changeLocator(const LocatorPrx&) const -{ - throw FixedProxyException(__FILE__, __LINE__); - return 0; // Keep the compiler happy. -} - -#endif - -ReferencePtr -IceInternal::FixedReference::changeTimeout(int) const -{ - throw FixedProxyException(__FILE__, __LINE__); - return 0; // Keep the compiler happy. -} - -void -IceInternal::FixedReference::streamWrite(BasicStream* s) const -{ - throw FixedProxyException(__FILE__, __LINE__); -} - -string -IceInternal::FixedReference::toString() const -{ - throw FixedProxyException(__FILE__, __LINE__); - return string(); // To keep the compiler from complaining. -} - -ConnectionPtr -IceInternal::FixedReference::getConnection() const -{ - vector<ConnectionPtr> connections = _fixedConnections; - switch(getMode()) - { - case ReferenceModeTwoway: - case ReferenceModeOneway: -#ifdef ICEE_HAS_BATCH - case ReferenceModeBatchOneway: -#endif - { - // - // Filter out datagram connections. - // - connections.erase(remove_if(connections.begin(), connections.end(), ConnectionIsDatagram()), - connections.end()); - break; - } - - case ReferenceModeDatagram: -#ifdef ICEE_HAS_BATCH - case ReferenceModeBatchDatagram: -#endif - { - // - // Filter out non-datagram connections. - // - connections.erase(remove_if(connections.begin(), connections.end(), not1(ConnectionIsDatagram())), - connections.end()); - break; - } - -#ifndef ICEE_HAS_BATCH - case ReferenceModeBatchDatagram: - case ReferenceModeBatchOneway: - { - throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode"); - } -#endif - } - - // - // Randomize the order of connections. - // - random_shuffle(connections.begin(), connections.end()); - - // - // If a secure connection is requested or secure overrides is set, - // remove all non-secure connections. Otherwise make non-secure - // connections preferred over secure connections by partitioning - // the connection vector, so that non-secure connections come - // first. - // - // NOTE: we don't use the stable_partition algorithm from STL to - // keep the code size down. - // - vector<ConnectionPtr>::iterator p = connections.begin(); - vector<ConnectionPtr> secureConnections; - while(p != connections.end()) - { - if((*p)->endpoint()->secure()) - { - secureConnections.push_back(*p); - p = connections.erase(p); - } - else - { - ++p; - } - } - if(getSecure()) - { - connections.swap(secureConnections); - } - else - { - connections.insert(connections.end(), secureConnections.begin(), secureConnections.end()); - } - - if(connections.empty()) - { - throw NoEndpointException(__FILE__, __LINE__); // No stringified representation for fixed proxies. - } - - ConnectionPtr connection = connections[0]; - assert(connection); - connection->throwException(); // Throw in case our connection is already destroyed. - - return connection; -} - -bool -IceInternal::FixedReference::operator==(const Reference& r) const -{ - if(this == &r) - { - return true; - } - const FixedReference* rhs = dynamic_cast<const FixedReference*>(&r); - if(!rhs || !Reference::operator==(r)) - { - return false; - } - return _fixedConnections == rhs->_fixedConnections; -} - -bool -IceInternal::FixedReference::operator<(const Reference& r) const -{ - if(this == &r) - { - return false; - } - if(Reference::operator<(r)) - { - return true; - } - if(Reference::operator==(r)) - { - const FixedReference* rhs = dynamic_cast<const FixedReference*>(&r); - assert(rhs); - return _fixedConnections < rhs->_fixedConnections; - } - return false; -} - -ReferencePtr -IceInternal::FixedReference::clone() const -{ - return new FixedReference(*this); -} - -IceInternal::FixedReference::FixedReference(const FixedReference& r) : - Reference(r), - _fixedConnections(r._fixedConnections) -{ -} - -#ifdef ICEE_HAS_ROUTER -IceUtil::Shared* IceInternal::upCast(IceInternal::RoutableReference* p) { return p; } - -vector<EndpointPtr> -IceInternal::RoutableReference::getRoutedEndpoints() const -{ - if(_routerInfo) - { - // - // If we route, we send everything to the router's client - // proxy endpoints. - // - return _routerInfo->getClientEndpoints(); - } - return vector<EndpointPtr>(); -} - -ReferencePtr -IceInternal::RoutableReference::changeRouter(const RouterPrx& newRouter) const -{ - RouterInfoPtr newRouterInfo = getInstance()->routerManager()->get(newRouter); - if(newRouterInfo == _routerInfo) - { - return RoutableReferencePtr(const_cast<RoutableReference*>(this)); - } - RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this)); - r->_routerInfo = newRouterInfo; - return r; -} - -int -IceInternal::RoutableReference::hash() const -{ - return Reference::hash(); -} - -bool -IceInternal::RoutableReference::operator==(const Reference& r) const -{ - // - // Note: if(this == &r) test is performed by each non-abstract derived class. - // - - const RoutableReference* rhs = dynamic_cast<const RoutableReference*>(&r); - if(!rhs || !Reference::operator==(r)) - { - return false; - } - return _routerInfo == rhs->_routerInfo; -} - -bool -IceInternal::RoutableReference::operator<(const Reference& r) const -{ - if(this == &r) - { - return false; - } - if(Reference::operator<(r)) - { - return true; - } - if(Reference::operator==(r)) - { - const RoutableReference* rhs = dynamic_cast<const RoutableReference*>(&r); - assert(rhs); - return _routerInfo < rhs->_routerInfo; - } - return false; -} - -IceInternal::RoutableReference::RoutableReference(const InstancePtr& inst, const CommunicatorPtr& com, - const Identity& ident, const Context& context, const string& fs, - ReferenceMode md, bool sec, const RouterInfoPtr& rtrInfo) : - Reference(inst, com, ident, context, fs, md, sec), _routerInfo(rtrInfo) -{ -} - -IceInternal::RoutableReference::RoutableReference(const RoutableReference& r) : - Reference(r), _routerInfo(r._routerInfo) -{ -} -#endif - -IceUtil::Shared* IceInternal::upCast(IceInternal::DirectReference* p) { return p; } - - -#ifdef ICEE_HAS_ROUTER -IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const CommunicatorPtr& com, - const Identity& ident, const Context& context, const string& fs, ReferenceMode md, - bool sec, const vector<EndpointPtr>& endpts, - const RouterInfoPtr& rtrInfo) : - - RoutableReference(inst, com, ident, context, fs, md, sec, rtrInfo), - _endpoints(endpts) -{ -} -#else -IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const CommunicatorPtr& com, - const Identity& ident, const Context& context, const string& fs, ReferenceMode md, - bool sec, const vector<EndpointPtr>& endpts) : - Reference(inst, com, ident, context, fs, md, sec), - _endpoints(endpts) -{ -} -#endif - -Reference::Type -IceInternal::DirectReference::getType() const -{ - return TypeDirect; -} - -vector<EndpointPtr> -IceInternal::DirectReference::getEndpoints() const -{ - return _endpoints; -} - -#ifdef ICEE_HAS_LOCATOR - -string -IceInternal::DirectReference::getAdapterId() const -{ - return string(); -} - -ReferencePtr -DirectReference::changeAdapterId(const string& newAdapterId) const -{ - if(!newAdapterId.empty()) - { - LocatorInfoPtr locatorInfo = - getInstance()->locatorManager()->get(getInstance()->referenceFactory()->getDefaultLocator()); - return getInstance()->referenceFactory()->create(getIdentity(), *getContext(), getFacet(), getMode(), - getSecure(), newAdapterId, -#ifdef ICEE_HAS_ROUTER - getRouterInfo(), -#endif - locatorInfo); - } - else - { - return DirectReferencePtr(const_cast<DirectReference*>(this)); - } -} - -ReferencePtr -IceInternal::DirectReference::changeLocator(const LocatorPrx& newLocator) const -{ - return DirectReferencePtr(const_cast<DirectReference*>(this)); -} - -#endif - -ReferencePtr -IceInternal::DirectReference::changeTimeout(int newTimeout) const -{ - DirectReferencePtr r = DirectReferencePtr::dynamicCast(Parent::changeTimeout(newTimeout)); - if(r.get() != this) // Also override the timeout on the endpoints if it was updated. - { - vector<EndpointPtr> newEndpoints; - for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p) - { - newEndpoints.push_back((*p)->timeout(newTimeout)); - } - r->_endpoints = newEndpoints; - } - return r; -} - -void -IceInternal::DirectReference::streamWrite(BasicStream* s) const -{ - Parent::streamWrite(s); - - Int sz = static_cast<Int>(_endpoints.size()); - s->writeSize(sz); - if(sz) - { - for(vector<EndpointPtr>::const_iterator p = _endpoints.begin(); p != _endpoints.end(); ++p) - { - (*p)->streamWrite(s); - } - } - else - { - s->write(string("")); // Adapter id. - } -} - -string -IceInternal::DirectReference::toString() const -{ - string result = Parent::toString(); - - vector<EndpointPtr>::const_iterator p; - for(p = _endpoints.begin(); p != _endpoints.end(); ++p) - { - string endp = (*p)->toString(); - if(!endp.empty()) - { - result.append(":"); - result.append(endp); - } - } - return result; -} - -ConnectionPtr -IceInternal::DirectReference::getConnection() const -{ -#ifdef ICEE_HAS_ROUTER - vector<EndpointPtr> endpts = Parent::getRoutedEndpoints(); - applyOverrides(endpts); - - if(endpts.empty()) - { - endpts = _endpoints; // Endpoint overrides are already applied on these endpoints. - } -#else - vector<EndpointPtr> endpts = _endpoints; -#endif - vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure()); - if(filteredEndpoints.empty()) - { - throw NoEndpointException(__FILE__, __LINE__, toString()); - } - - OutgoingConnectionFactoryPtr factory = getInstance()->outgoingConnectionFactory(); - ConnectionPtr connection = factory->create(filteredEndpoints); - assert(connection); - -#if defined(ICEE_HAS_ROUTER) && !defined(ICEE_PURE_CLIENT) - - // - // If we have a router, set the object adapter for this router - // (if any) to the new connection, so that callbacks from the - // router can be received over this new connection. - // - if(getRouterInfo()) - { - connection->setAdapter(getRouterInfo()->getAdapter()); - } -#endif - - return connection; -} - -bool -IceInternal::DirectReference::operator==(const Reference& r) const -{ - if(this == &r) - { - return true; - } - const DirectReference* rhs = dynamic_cast<const DirectReference*>(&r); - if(!rhs || !Parent::operator==(r)) - { - return false; - } - return _endpoints == rhs->_endpoints; -} - -bool -IceInternal::DirectReference::operator<(const Reference& r) const -{ - if(this == &r) - { - return false; - } - if(Parent::operator<(r)) - { - return true; - } - if(Parent::operator==(r)) - { - const DirectReference* rhs = dynamic_cast<const DirectReference*>(&r); - assert(rhs); - return _endpoints < rhs->_endpoints; - } - return false; -} - -ReferencePtr -IceInternal::DirectReference::clone() const -{ - return new DirectReference(*this); -} - -IceInternal::DirectReference::DirectReference(const DirectReference& r) : - Parent(r), _endpoints(r._endpoints) -{ -} - -#ifdef ICEE_HAS_LOCATOR - -IceUtil::Shared* IceInternal::upCast(IceInternal::IndirectReference* p) { return p; } - -#ifdef ICEE_HAS_ROUTER -IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const CommunicatorPtr& com, - const Identity& ident, const Context& context, const string& fs, - ReferenceMode md, bool sec, const string& adptid, - const RouterInfoPtr& rtrInfo, const LocatorInfoPtr& locInfo) : - RoutableReference(inst, com, ident, context, fs, md, sec, rtrInfo), - _adapterId(adptid), - _locatorInfo(locInfo) -{ -} -#else -IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const CommunicatorPtr& com, - const Identity& ident, const Context& context, const string& fs, - ReferenceMode md, bool sec, const string& adptid, - const LocatorInfoPtr& locInfo) : - Reference(inst, com, ident, context, fs, md, sec), - _adapterId(adptid), - _locatorInfo(locInfo) -{ -} -#endif - -Reference::Type -IceInternal::IndirectReference::getType() const -{ - return TypeIndirect; -} - -vector<EndpointPtr> -IceInternal::IndirectReference::getEndpoints() const -{ - return vector<EndpointPtr>(); -} - -string -IceInternal::IndirectReference::getAdapterId() const -{ - return _adapterId; -} - -ReferencePtr -IceInternal::IndirectReference::changeAdapterId(const string& newAdapterId) const -{ - if(newAdapterId == _adapterId) - { - return IndirectReferencePtr(const_cast<IndirectReference*>(this)); - } - IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this)); - r->_adapterId = newAdapterId; - return r; -} - -ReferencePtr -IceInternal::IndirectReference::changeLocator(const LocatorPrx& newLocator) const -{ - LocatorInfoPtr newLocatorInfo = getInstance()->locatorManager()->get(newLocator); - if(newLocatorInfo == _locatorInfo) - { - return IndirectReferencePtr(const_cast<IndirectReference*>(this)); - } - IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this)); - r->_locatorInfo = newLocatorInfo; - return r; -} - -void -IceInternal::IndirectReference::streamWrite(BasicStream* s) const -{ - Parent::streamWrite(s); - - s->writeSize(0); - s->write(_adapterId); -} - -string -IceInternal::IndirectReference::toString() const -{ - string result = Parent::toString(); - if(_adapterId.empty()) - { - return result; - } - - result.append(" @ "); - - // - // If the encoded adapter id string contains characters which the - // reference parser uses as separators, then we enclose the - // adapter id string in quotes. - // - string a = _adapterId; -#ifdef ICEE_HAS_WSTRING - if(getInstance()->initializationData().stringConverter) - { - UTF8BufferI buffer; - Byte* last = getInstance()->initializationData().stringConverter->toUTF8(a.data(), a.data() + a.size(), buffer); - a = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } -#endif - a = IceUtil::escapeString(a, ""); - if(a.find_first_of(" ") != string::npos) - { - result.append("\""); - result.append(a); - result.append("\""); - } - else - { - result.append(_adapterId); - } - return result; -} - -ConnectionPtr -IceInternal::IndirectReference::getConnection() const -{ - ConnectionPtr connection; - - while(true) - { -#ifdef ICEE_HAS_ROUTER - vector<EndpointPtr> endpts = Parent::getRoutedEndpoints(); -#else - vector<EndpointPtr> endpts; -#endif - bool cached = false; - if(endpts.empty() && _locatorInfo) - { - const IndirectReferencePtr self = const_cast<IndirectReference*>(this); - endpts = _locatorInfo->getEndpoints(self, cached); - } - - applyOverrides(endpts); - - vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure()); - if(filteredEndpoints.empty()) - { - throw NoEndpointException(__FILE__, __LINE__, toString()); - } - - try - { - OutgoingConnectionFactoryPtr factory = getInstance()->outgoingConnectionFactory(); - connection = factory->create(filteredEndpoints); - assert(connection); - } - catch(const LocalException& ex) - { -#ifdef ICEE_HAS_ROUTER - if(!getRouterInfo()) -#endif - { - assert(_locatorInfo); - const IndirectReferencePtr self = const_cast<IndirectReference*>(this); - _locatorInfo->clearCache(self); - - if(cached) - { - TraceLevelsPtr traceLevels = getInstance()->traceLevels(); - if(traceLevels->retry >= 2) - { - Trace out(getInstance()->initializationData().logger, traceLevels->retryCat); - out << "connection to cached endpoints failed\n" - << "removing endpoints from cache and trying one more time\n" << ex.toString(); - } - continue; - } - } - - throw; - } - - break; - } - -#if defined(ICEE_HAS_ROUTER) && !defined(ICEE_PURE_CLIENT) - // - // If we have a router, set the object adapter for this router - // (if any) to the new connection, so that callbacks from the - // router can be received over this new connection. - // - if(getRouterInfo()) - { - connection->setAdapter(getRouterInfo()->getAdapter()); - } -#endif - - assert(connection); - return connection; -} - -int -IceInternal::IndirectReference::hash() const -{ - IceUtil::RecMutex::Lock sync(_hashMutex); - - if(_hashInitialized) - { - return _hashValue; - } -#ifdef ICEE_HAS_ROUTER - RoutableReference::hash(); // Initializes _hashValue. -#else - Reference::hash(); // Initializes _hashValue. -#endif - // Add hash of adapter ID to base hash - for(string::const_iterator p = _adapterId.begin(); p != _adapterId.end(); ++p) - { - _hashValue = 5 * _hashValue + *p; - } - return _hashValue; -} - -bool -IceInternal::IndirectReference::operator==(const Reference& r) const -{ - if(this == &r) - { - return true; - } - const IndirectReference* rhs = dynamic_cast<const IndirectReference*>(&r); - if(!rhs || !Parent::operator==(r)) - { - return false; - } - return _adapterId == rhs->_adapterId && _locatorInfo == rhs->_locatorInfo; -} - -bool -IceInternal::IndirectReference::operator<(const Reference& r) const -{ - if(this == &r) - { - return false; - } - if(Parent::operator<(r)) - { - return true; - } - if(Parent::operator==(r)) - { - const IndirectReference* rhs = dynamic_cast<const IndirectReference*>(&r); - assert(rhs); - if(_adapterId < rhs->_adapterId) - { - return true; - } - else if(rhs->_adapterId < _adapterId) - { - return false; - } - return _locatorInfo < rhs->_locatorInfo; - } - return false; -} - -ReferencePtr -IceInternal::IndirectReference::clone() const -{ - return new IndirectReference(*this); -} - -IceInternal::IndirectReference::IndirectReference(const IndirectReference& r) - : Parent(r), - _adapterId(r._adapterId), - _locatorInfo(r._locatorInfo) -{ -} - -#endif // ICEE_HAS_LOCATOR - -vector<EndpointPtr> -IceInternal::filterEndpoints(const vector<EndpointPtr>& allEndpoints, ReferenceMode m, bool sec) -{ - vector<EndpointPtr> endpoints = allEndpoints; - - // - // Filter out unknown endpoints. - // - endpoints.erase(remove_if(endpoints.begin(), endpoints.end(), Ice::constMemFun(&Endpoint::unknown)), - endpoints.end()); - - // - // Filter out endpoints according to the mode of the reference. - // - switch(m) - { - case ReferenceModeTwoway: - case ReferenceModeOneway: -#ifdef ICEE_HAS_BATCH - case ReferenceModeBatchOneway: -#endif - { - // - // Filter out datagram endpoints. - // - endpoints.erase(remove_if(endpoints.begin(), endpoints.end(), Ice::constMemFun(&Endpoint::datagram)), - endpoints.end()); - break; - } - - case ReferenceModeDatagram: -#ifdef ICEE_HAS_BATCH - case ReferenceModeBatchDatagram: -#endif - { - // - // Filter out non-datagram endpoints. - // - endpoints.erase(remove_if(endpoints.begin(), endpoints.end(), - not1(Ice::constMemFun(&Endpoint::datagram))), - endpoints.end()); - break; - } - -#ifndef ICEE_HAS_BATCH - case ReferenceModeBatchDatagram: - case ReferenceModeBatchOneway: - { - throw FeatureNotSupportedException(__FILE__, __LINE__, "batch proxy mode"); - } -#endif - } - - // - // Randomize the order of endpoints. - // - random_shuffle(endpoints.begin(), endpoints.end()); - - // - // If a secure connection is requested or secure overrides is set, - // remove all non-secure endpoints. Otherwise make non-secure - // endpoints preferred over secure endpoints by partitioning - // the endpoint vector, so that non-secure endpoints come - // first. - // - // NOTE: we don't use the stable_partition algorithm from STL to - // keep the code size down. - // - vector<EndpointPtr>::iterator p = endpoints.begin(); - vector<EndpointPtr> secureEndpoints; - while(p != endpoints.end()) - { - if((*p)->secure()) - { - secureEndpoints.push_back(*p); - p = endpoints.erase(p); - } - else - { - ++p; - } - } - if(sec) - { - endpoints.swap(secureEndpoints); - } - else - { - endpoints.insert(endpoints.end(), secureEndpoints.begin(), secureEndpoints.end()); - } - - return endpoints; -} diff --git a/cppe/src/IceE/Reference.h b/cppe/src/IceE/Reference.h deleted file mode 100644 index d8297d832a2..00000000000 --- a/cppe/src/IceE/Reference.h +++ /dev/null @@ -1,336 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_REFERENCE_H -#define ICEE_REFERENCE_H - -#include <IceE/ReferenceF.h> -#include <IceE/EndpointF.h> -#include <IceE/InstanceF.h> -#include <IceE/CommunicatorF.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfoF.h> -# include <IceE/RouterF.h> -#endif -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfoF.h> -# include <IceE/LocatorF.h> -#endif -#include <IceE/ConnectionF.h> -#include <IceE/Shared.h> -#include <IceE/RecMutex.h> -#include <IceE/Identity.h> - -namespace IceInternal -{ - -class BasicStream; - -class Reference : public IceUtil::Shared -{ -public: - - enum Type - { - TypeDirect, - TypeIndirect, - TypeFixed - }; - - // - // The reference mode in Ice-E is defined in ReferenceF.h to allow the proxy - // to inline methods such as ice_twoway, ice_isTwoway, etc. - // -// enum Mode -// { -// ModeTwoway, -// ModeOneway, -// ModeBatchOneway, -// ModeDatagram, -// ModeBatchDatagram, -// ModeLast = ModeBatchDatagram -// }; - - ReferenceMode getMode() const { return _mode; } - bool getSecure() const { return _secure; }; - const Ice::Identity& getIdentity() const { return _identity; } - const std::string& getFacet() const { return _facet; } - const InstancePtr& getInstance() const { return _instance; } - const Ice::Context* getContext() const { return &_context; } - - Ice::CommunicatorPtr getCommunicator() const; - - virtual Type getType() const = 0; - virtual std::vector<EndpointPtr> getEndpoints() const = 0; - -#ifdef ICEE_HAS_ROUTER - virtual RouterInfoPtr getRouterInfo() const { return 0; } -#endif -#ifdef ICEE_HAS_LOCATOR - virtual std::string getAdapterId() const = 0; - virtual LocatorInfoPtr getLocatorInfo() const { return 0; } -#endif - - // - // The change* methods (here and in derived classes) create - // a new reference based on the existing one, with the - // corresponding value changed. - // - ReferencePtr changeContext(const Ice::Context&) const; - ReferencePtr changeMode(ReferenceMode) const; - ReferencePtr changeSecure(bool) const; - ReferencePtr changeIdentity(const Ice::Identity&) const; - ReferencePtr changeFacet(const std::string&) const; - -#ifdef ICEE_HAS_ROUTER - virtual ReferencePtr changeRouter(const Ice::RouterPrx&) const = 0; -#endif -#ifdef ICEE_HAS_LOCATOR - virtual ReferencePtr changeAdapterId(const std::string&) const = 0; - virtual ReferencePtr changeLocator(const Ice::LocatorPrx&) const = 0; -#endif - virtual ReferencePtr changeTimeout(int) const; - - int hash() const; // Conceptually const. - - // - // Marshal the reference. - // - virtual void streamWrite(BasicStream*) const; - - // - // Convert the reference to its string form. - // - virtual std::string toString() const; - - // - // Get a suitable connection for this reference. - // - virtual Ice::ConnectionPtr getConnection() const = 0; - - virtual bool operator==(const Reference&) const = 0; - virtual bool operator<(const Reference&) const = 0; - - virtual ReferencePtr clone() const = 0; - -protected: - - Reference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&, - const std::string&, ReferenceMode, bool); - Reference(const Reference&); - - void applyOverrides(std::vector<EndpointPtr>&) const; - - IceUtil::RecMutex _hashMutex; // For lazy initialization of hash value. - mutable Ice::Int _hashValue; - mutable bool _hashInitialized; - -private: - - const InstancePtr _instance; - const Ice::CommunicatorPtr _communicator; - - ReferenceMode _mode; - bool _secure; - Ice::Identity _identity; - Ice::Context _context; - std::string _facet; - - // - // NOTE: The override timeout should theoritically be in - // RoutableReference. However, since RoutableReference is only - // defined if the ICEE_HAS_ROUTER macro is defined, it would also - // have to be conditionally defined here. To simplify, we just - // define it here. - // - bool _overrideTimeout; - int _timeout; // Only used if _overrideTimeout == true -}; - -class FixedReference : public Reference -{ -public: - - FixedReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&, - const std::string&, ReferenceMode, const std::vector<Ice::ConnectionPtr>&); - - virtual Type getType() const; - virtual std::vector<EndpointPtr> getEndpoints() const; - -#ifdef ICEE_HAS_ROUTER - virtual ReferencePtr changeRouter(const Ice::RouterPrx&) const; -#endif -#ifdef ICEE_HAS_LOCATOR - virtual std::string getAdapterId() const; - virtual ReferencePtr changeAdapterId(const std::string&) const; - virtual ReferencePtr changeLocator(const Ice::LocatorPrx&) const; -#endif - virtual ReferencePtr changeTimeout(int) const; - - virtual void streamWrite(BasicStream*) const; - virtual std::string toString() const; - - virtual Ice::ConnectionPtr getConnection() const; - - virtual bool operator==(const Reference&) const; - virtual bool operator<(const Reference&) const; - - virtual ReferencePtr clone() const; - -protected: - - FixedReference(const FixedReference&); - -private: - - std::vector<Ice::ConnectionPtr> _fixedConnections; -}; - -#ifdef ICEE_HAS_ROUTER -class RoutableReference : public Reference -{ -public: - - virtual RouterInfoPtr getRouterInfo() const { return _routerInfo; } - std::vector<EndpointPtr> getRoutedEndpoints() const; - - virtual ReferencePtr changeRouter(const Ice::RouterPrx&) const; - - virtual Ice::ConnectionPtr getConnection() const = 0; - - int hash() const; // Conceptually const. - - virtual bool operator==(const Reference&) const = 0; - virtual bool operator<(const Reference&) const = 0; - - virtual ReferencePtr clone() const = 0; - -protected: - - RoutableReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&, - const std::string&, ReferenceMode, bool, const RouterInfoPtr&); - RoutableReference(const RoutableReference&); - - -private: - - RouterInfoPtr _routerInfo; // Null if no router is used. -}; -#endif - -class DirectReference : -#ifdef ICEE_HAS_ROUTER - public RoutableReference -#else - public Reference -#endif -{ -public: - - DirectReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&, - const std::string&, ReferenceMode, bool, const std::vector<EndpointPtr>& -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& -#endif - ); - - virtual Type getType() const; - virtual std::vector<EndpointPtr> getEndpoints() const; - -#ifdef ICEE_HAS_LOCATOR - virtual std::string getAdapterId() const; - virtual ReferencePtr changeAdapterId(const std::string&) const; - virtual ReferencePtr changeLocator(const Ice::LocatorPrx&) const; -#endif - virtual ReferencePtr changeTimeout(int) const; - - virtual void streamWrite(BasicStream*) const; - virtual std::string toString() const; - virtual Ice::ConnectionPtr getConnection() const; - - virtual bool operator==(const Reference&) const; - virtual bool operator<(const Reference&) const; - - virtual ReferencePtr clone() const; - -protected: - - DirectReference(const DirectReference&); - -private: - - std::vector<EndpointPtr> _endpoints; - -#ifdef ICEE_HAS_ROUTER - typedef RoutableReference Parent; -#else - typedef Reference Parent; -#endif -}; - -#ifdef ICEE_HAS_LOCATOR - -class IndirectReference : -#ifdef ICEE_HAS_ROUTER - public RoutableReference -#else - public Reference -#endif -{ -public: - - IndirectReference(const InstancePtr&, const Ice::CommunicatorPtr&, const Ice::Identity&, const Ice::Context&, - const std::string&, ReferenceMode, bool, const std::string& -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& -#endif - , const LocatorInfoPtr&); - - virtual LocatorInfoPtr getLocatorInfo() const { return _locatorInfo; } - - virtual Type getType() const; - virtual std::vector<EndpointPtr> getEndpoints() const; - virtual std::string getAdapterId() const; - - virtual ReferencePtr changeAdapterId(const std::string&) const; - virtual ReferencePtr changeLocator(const Ice::LocatorPrx&) const; - - virtual void streamWrite(BasicStream*) const; - virtual std::string toString() const; - virtual Ice::ConnectionPtr getConnection() const; - - int hash() const; // Conceptually const. - - virtual bool operator==(const Reference&) const; - virtual bool operator<(const Reference&) const; - - virtual ReferencePtr clone() const; - -protected: - - IndirectReference(const IndirectReference&); - -private: - - std::string _adapterId; - LocatorInfoPtr _locatorInfo; -#ifdef ICEE_HAS_ROUTER - typedef RoutableReference Parent; -#else - typedef Reference Parent; -#endif -}; - -#endif // ICEE_HAS_LOCATOR - -std::vector<EndpointPtr> filterEndpoints(const std::vector<EndpointPtr>&, ReferenceMode, bool); - -} - -#endif diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp deleted file mode 100644 index c78261d9fa7..00000000000 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ /dev/null @@ -1,737 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ReferenceFactory.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/Endpoint.h> -#include <IceE/EndpointFactory.h> -#ifdef ICEE_HAS_ROUTER -# include <IceE/RouterInfo.h> -# include <IceE/Router.h> -#endif -#ifdef ICEE_HAS_LOCATOR -# include <IceE/LocatorInfo.h> -# include <IceE/Locator.h> -#endif -#include <IceE/BasicStream.h> -#include <IceE/StringUtil.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Properties.h> -#include <IceE/Communicator.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(::IceInternal::ReferenceFactory* p) { return p; } - -ReferencePtr -IceInternal::ReferenceFactory::copy(const Reference* r) const -{ - Mutex::Lock sync(*this); - - if(!_instance) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - const Ice::Identity& ident = r->getIdentity(); - if(ident.name.empty() && ident.category.empty()) - { - return 0; - } - - return r->clone(); -} - -ReferencePtr -IceInternal::ReferenceFactory::create(const Identity& ident, - const Context& context, - const string& facet, - ReferenceMode mode, - bool secure, - const vector<EndpointPtr>& endpoints -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& routerInfo -#endif - ) -{ - Mutex::Lock sync(*this); - - if(!_instance) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - if(ident.name.empty() && ident.category.empty()) - { - return 0; - } - - // - // Create new reference - // -#ifdef ICEE_HAS_ROUTER - return new DirectReference(_instance, _communicator, ident, context, facet, mode, secure, endpoints, routerInfo); -#else - return new DirectReference(_instance, _communicator, ident, context, facet, mode, secure, endpoints); -#endif -} - -#ifdef ICEE_HAS_LOCATOR - -ReferencePtr -IceInternal::ReferenceFactory::create(const Identity& ident, - const Context& context, - const string& facet, - ReferenceMode mode, - bool secure, - const string& adapterId -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& routerInfo -#endif - , const LocatorInfoPtr& locatorInfo) -{ - Mutex::Lock sync(*this); - - if(!_instance) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - if(ident.name.empty() && ident.category.empty()) - { - return 0; - } - - // - // Create new reference - // -#ifdef ICEE_HAS_ROUTER - return new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure, adapterId, routerInfo, - locatorInfo); -#else - return new IndirectReference(_instance, _communicator, ident, context, facet, mode, secure, adapterId, locatorInfo); -#endif -} - -#endif - -ReferencePtr -IceInternal::ReferenceFactory::create(const Identity& ident, - const Context& context, - const string& facet, - ReferenceMode mode, - const vector<Ice::ConnectionPtr>& fixedConnections) -{ - Mutex::Lock sync(*this); - - if(!_instance) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - if(ident.name.empty() && ident.category.empty()) - { - return 0; - } - - // - // Create new reference - // - return new FixedReference(_instance, _communicator, ident, context, facet, mode, fixedConnections); -} - -ReferencePtr -IceInternal::ReferenceFactory::create(const string& str) -{ - if(str.empty()) - { - return 0; - } - - const string delim = " \t\n\r"; - - string s(str); - string::size_type beg; - string::size_type end = 0; - - beg = s.find_first_not_of(delim, end); - if(beg == string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - // - // Extract the identity, which may be enclosed in single - // or double quotation marks. - // - string idstr; - end = IceUtil::checkQuote(s, beg); - if(end == string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - else if(end == 0) - { - end = s.find_first_of(delim + ":@", beg); - if(end == string::npos) - { - end = s.size(); - } - idstr = s.substr(beg, end - beg); - } - else - { - beg++; // Skip leading quote - idstr = s.substr(beg, end - beg); - end++; // Skip trailing quote - } - - if(beg == end) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - // - // Parsing the identity may raise IdentityParseException. - // - Identity ident = _instance->stringToIdentity(idstr); - - if(ident.name.empty()) - { - // - // An identity with an empty name and a non-empty - // category is illegal. - // - if(!ident.category.empty()) - { - throw IllegalIdentityException(__FILE__, __LINE__, ident); - } - // - // Treat a stringified proxy containing two double - // quotes ("") the same as an empty string, i.e., - // a null proxy, but only if nothing follows the - // quotes. - // - else if(s.find_first_not_of(delim, end) != string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - else - { - return 0; - } - } - - string facet; - ReferenceMode mode = ReferenceModeTwoway; - bool secure = false; - string adapter; - - while(true) - { - beg = s.find_first_not_of(delim, end); - if(beg == string::npos) - { - break; - } - - if(s[beg] == ':' || s[beg] == '@') - { - break; - } - - end = s.find_first_of(delim + ":@", beg); - if(end == string::npos) - { - end = s.length(); - } - - if(beg == end) - { - break; - } - - string option = s.substr(beg, end - beg); - if(option.length() != 2 || option[0] != '-') - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - // - // Check for the presence of an option argument. The - // argument may be enclosed in single or double - // quotation marks. - // - string argument; - string::size_type argumentBeg = s.find_first_not_of(delim, end); - if(argumentBeg != string::npos) - { - if(s[argumentBeg] != '@' && s[argumentBeg] != ':' && s[argumentBeg] != '-') - { - beg = argumentBeg; - end = IceUtil::checkQuote(s, beg); - if(end == string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - else if(end == 0) - { - end = s.find_first_of(delim + ":@", beg); - if(end == string::npos) - { - end = s.size(); - } - argument = s.substr(beg, end - beg); - } - else - { - beg++; // Skip leading quote - argument = s.substr(beg, end - beg); - end++; // Skip trailing quote - } - } - } - - // - // If any new options are added here, - // IceInternal::Reference::toString() and its derived classes must be updated as well. - // - switch(option[1]) - { - case 'f': - { - if(argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - if(!IceUtil::unescapeString(argument, 0, argument.size(), facet)) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } -#ifdef ICEE_HAS_WSTRING - if(_instance->initializationData().stringConverter) - { - string tmpFacet; - _instance->initializationData().stringConverter->fromUTF8( - reinterpret_cast<const Byte*>(facet.data()), - reinterpret_cast<const Byte*>(facet.data() + facet.size()), tmpFacet); - facet = tmpFacet; - } -#endif - break; - } - - case 't': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - mode = ReferenceModeTwoway; - break; - } - - case 'o': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - mode = ReferenceModeOneway; - break; - } - - case 'O': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - mode = ReferenceModeBatchOneway; - break; - } - - case 'd': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - mode = ReferenceModeDatagram; - break; - } - - case 'D': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - mode = ReferenceModeBatchDatagram; - break; - } - - case 's': - { - if(!argument.empty()) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - secure = true; - break; - } - - default: - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - } - } - -#ifdef ICEE_HAS_ROUTER - RouterInfoPtr routerInfo = _instance->routerManager()->get(getDefaultRouter()); -#endif -#ifdef ICEE_HAS_LOCATOR - LocatorInfoPtr locatorInfo = _instance->locatorManager()->get(getDefaultLocator()); -#endif - - if(beg == string::npos) - { -#ifdef ICEE_HAS_LOCATOR -# ifdef ICEE_HAS_ROUTER - return create(ident, Ice::Context(), facet, mode, secure, "", routerInfo, locatorInfo); -# else - return create(ident, Ice::Context(), facet, mode, secure, "", locatorInfo); -# endif -#else - throw FeatureNotSupportedException(__FILE__, __LINE__, - "indirect proxy `" + str + "' (no locator support built-in)"); -#endif - } - vector<EndpointPtr> endpoints; - - switch(s[beg]) - { - case ':': - { - vector<string> unknownEndpoints; - end = beg; - - while(end < s.length() && s[end] == ':') - { - beg = end + 1; - - end = s.find(':', beg); - if(end == string::npos) - { - end = s.length(); - } - - string es = s.substr(beg, end - beg); - EndpointPtr endp = _instance->endpointFactory()->create(es); - if(endp != 0) - { - vector<EndpointPtr> endps = endp->expand(false); - endpoints.insert(endpoints.end(), endps.begin(), endps.end()); - } - else - { - unknownEndpoints.push_back(es); - } - } - if(endpoints.size() == 0) - { - throw EndpointParseException(__FILE__, __LINE__, unknownEndpoints.front()); - } - else if(unknownEndpoints.size() != 0 && - _instance->initializationData().properties->getPropertyAsIntWithDefault( - "Ice.Warn.Endpoints", 1) > 0) - { - Warning out(_instance->initializationData().logger); - out << "Proxy contains unknown endpoints:"; - for(unsigned int idx = 0; idx < unknownEndpoints.size(); ++idx) - { - out << " `" << unknownEndpoints[idx] << "'"; - } - } - -#ifdef ICEE_HAS_ROUTER - return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo); -#else - return create(ident, Ice::Context(), facet, mode, secure, endpoints); -#endif - break; - } - - case '@': - { -#ifdef ICEE_HAS_LOCATOR - beg = s.find_first_not_of(delim, beg + 1); - if(beg == string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - string adapterstr; - end = IceUtil::checkQuote(s, beg); - if(end == string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - else if(end == 0) - { - end = s.find_first_of(delim, beg); - if(end == string::npos) - { - end = s.size(); - } - adapterstr = s.substr(beg, end - beg); - } - else - { - beg++; // Skip leading quote - adapterstr = s.substr(beg, end - beg); - end++; // Skip trailing quote. - } - - // Check for trailing whitespace. - if(end != string::npos && s.find_first_not_of(delim, end) != string::npos) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - - if(!IceUtil::unescapeString(adapterstr, 0, adapterstr.size(), adapter) || adapter.size() == 0) - { - throw ProxyParseException(__FILE__, __LINE__, str); - } -#ifdef ICEE_HAS_WSTRING - if(_instance->initializationData().stringConverter) - { - string tmpAdapter; - _instance->initializationData().stringConverter->fromUTF8( - reinterpret_cast<const Byte*>(adapter.data()), - reinterpret_cast<const Byte*>(adapter.data() + adapter.size()), tmpAdapter); - adapter = tmpAdapter; - } -#endif - -#ifdef ICEE_HAS_ROUTER - return create(ident, Ice::Context(), facet, mode, secure, adapter, routerInfo, locatorInfo); -#else - return create(ident, Ice::Context(), facet, mode, secure, adapter, locatorInfo); -#endif -#else - throw FeatureNotSupportedException(__FILE__, __LINE__, - "indirect proxy `" + str + "' (no locator support built-in)"); -#endif - break; - } - - default: - { - throw ProxyParseException(__FILE__, __LINE__, str); - } - } - - return 0; // Unreachable, fixes compiler warning. -} - -ReferencePtr -IceInternal::ReferenceFactory::createFromProperties(const string& propertyPrefix) -{ - PropertiesPtr properties = _instance->initializationData().properties; - - ReferencePtr ref = create(properties->getProperty(propertyPrefix)); - if(!ref) - { - return 0; - } - -#ifdef ICEE_HAS_LOCATOR - string property = propertyPrefix + ".Locator"; - if(!properties->getProperty(property).empty()) - { - ref = ref->changeLocator( - LocatorPrx::uncheckedCast(_communicator->propertyToProxy(property))); - if(ref->getType() == Reference::TypeDirect) - { - Warning out(_instance->initializationData().logger); - out << "`" << property << "=" << properties->getProperty(property) - << "': cannot set a locator on a direct reference; setting ignored"; - } - } -#endif - -#ifdef ICEE_HAS_ROUTER - property = propertyPrefix + ".Router"; - if(!properties->getProperty(property).empty()) - { - if(propertyPrefix.size() > 7 && propertyPrefix.substr(propertyPrefix.size() - 7, 7) == ".Router") - { - Warning out(_instance->initializationData().logger); - out << "`" << property << "=" << properties->getProperty(property) - << "': cannot set a router on a router; setting ignored"; - } - else - { - ref = ref->changeRouter( - RouterPrx::uncheckedCast(_communicator->propertyToProxy(property))); - } - } -#endif - - return ref; -} - -ReferencePtr -IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) -{ - // - // Don't read the identity here. Operations calling this - // constructor read the identity, and pass it as a parameter. - // - - if(ident.name.empty() && ident.category.empty()) - { - return 0; - } - - // - // For compatibility with the old FacetPath. - // - vector<string> facetPath; - s->read(facetPath); - string facet; - if(!facetPath.empty()) - { - if(facetPath.size() > 1) - { - throwProxyUnmarshalException(__FILE__, __LINE__); - } - facet.swap(facetPath[0]); - } - - Byte modeAsByte; - s->read(modeAsByte); - ReferenceMode mode = static_cast<ReferenceMode>(modeAsByte); - if(mode < 0 || mode > ReferenceModeLast) - { - throwProxyUnmarshalException(__FILE__, __LINE__); - } - - vector<EndpointPtr> endpoints; - string adapterId; - -#ifdef ICEE_HAS_ROUTER - RouterInfoPtr routerInfo = _instance->routerManager()->get(getDefaultRouter()); -#endif - - bool secure; - s->read(secure); - - Ice::Int sz; - s->readSize(sz); - - if(sz > 0) - { - endpoints.reserve(sz); - while(sz--) - { - EndpointPtr endpoint = _instance->endpointFactory()->read(s); - endpoints.push_back(endpoint); - } -#ifdef ICEE_HAS_ROUTER - return create(ident, Ice::Context(), facet, mode, secure, endpoints, routerInfo); -#else - return create(ident, Ice::Context(), facet, mode, secure, endpoints); -#endif - } - else - { -#ifdef ICEE_HAS_LOCATOR - LocatorInfoPtr locatorInfo = _instance->locatorManager()->get(getDefaultLocator()); - s->read(adapterId); -# ifdef ICEE_HAS_ROUTER - return create(ident, Ice::Context(), facet, mode, secure, adapterId, routerInfo, locatorInfo); -# else - return create(ident, Ice::Context(), facet, mode, secure, adapterId, locatorInfo); -# endif -#else - throwProxyUnmarshalException(__FILE__, __LINE__); - return 0; // Unreachable, fixes compiler warning. -#endif - } -} - -#ifdef ICEE_HAS_ROUTER - -void -IceInternal::ReferenceFactory::setDefaultRouter(const RouterPrx& defaultRouter) -{ - IceUtil::Mutex::Lock sync(*this); - _defaultRouter = defaultRouter; -} - -RouterPrx -IceInternal::ReferenceFactory::getDefaultRouter() const -{ - IceUtil::Mutex::Lock sync(*this); - return _defaultRouter; -} - -#endif - -#ifdef ICEE_HAS_LOCATOR - -void -IceInternal::ReferenceFactory::setDefaultLocator(const LocatorPrx& defaultLocator) -{ - IceUtil::Mutex::Lock sync(*this); - _defaultLocator = defaultLocator; -} - -LocatorPrx -IceInternal::ReferenceFactory::getDefaultLocator() const -{ - IceUtil::Mutex::Lock sync(*this); - return _defaultLocator; -} - -#endif - -IceInternal::ReferenceFactory::ReferenceFactory(const InstancePtr& instance, - const CommunicatorPtr& communicator) : - _instance(instance), - _communicator(communicator) -{ -} - -void -IceInternal::ReferenceFactory::destroy() -{ - Mutex::Lock sync(*this); - - if(!_instance) - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - - _instance = 0; - _communicator = 0; -#ifdef ICEE_HAS_ROUTER - _defaultRouter = 0; -#endif -#ifdef ICEE_HAS_LOCATOR - _defaultLocator = 0; -#endif -} diff --git a/cppe/src/IceE/ReferenceFactory.h b/cppe/src/IceE/ReferenceFactory.h deleted file mode 100644 index d867a926340..00000000000 --- a/cppe/src/IceE/ReferenceFactory.h +++ /dev/null @@ -1,100 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_REFERENCE_FACTORY_H -#define ICEE_REFERENCE_FACTORY_H - -#include <IceE/ReferenceFactoryF.h> -#include <IceE/ConnectionF.h> -#include <IceE/Shared.h> -#include <IceE/Mutex.h> -#include <IceE/Reference.h> // For ReferenceMode - -namespace IceInternal -{ - -class ReferenceFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex -{ -public: - - // - // Make a polymorphic copy of a reference. - // - ReferencePtr copy(const Reference* r) const; - - // - // Create a direct reference. - // - ReferencePtr create(const ::Ice::Identity&, const Ice::Context&, const ::std::string&, ReferenceMode, bool, - const ::std::vector<EndpointPtr>& -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& -#endif - ); - // - // Create an indirect reference. - // -#ifdef ICEE_HAS_LOCATOR - ReferencePtr create(const ::Ice::Identity&, const Ice::Context&, const ::std::string&, ReferenceMode, bool, - const ::std::string& -#ifdef ICEE_HAS_ROUTER - , const RouterInfoPtr& -#endif - , const LocatorInfoPtr&); -#endif - // - // Create a fixed reference. - // - ReferencePtr create(const ::Ice::Identity&, const Ice::Context&, const ::std::string&, ReferenceMode, - const ::std::vector< ::Ice::ConnectionPtr>&); - - // - // Create a reference from a string. - // - ReferencePtr create(const ::std::string&); - - // - // Create a reference by unmarshaling it from a stream. - // - ReferencePtr create(const ::Ice::Identity&, BasicStream*); - - // - // Create a reference from a property set. - // - ReferencePtr createFromProperties(const ::std::string&); - -#ifdef ICEE_HAS_ROUTER - void setDefaultRouter(const ::Ice::RouterPrx&); - ::Ice::RouterPrx getDefaultRouter() const; -#endif - -#ifdef ICEE_HAS_LOCATOR - void setDefaultLocator(const ::Ice::LocatorPrx&); - ::Ice::LocatorPrx getDefaultLocator() const; -#endif - -private: - - ReferenceFactory(const InstancePtr&, const Ice::CommunicatorPtr&); - void destroy(); - friend class Instance; - - InstancePtr _instance; - Ice::CommunicatorPtr _communicator; -#ifdef ICEE_HAS_ROUTER - ::Ice::RouterPrx _defaultRouter; -#endif -#ifdef ICEE_HAS_LOCATOR - ::Ice::LocatorPrx _defaultLocator; -#endif -}; - -} - -#endif diff --git a/cppe/src/IceE/ReferenceFactoryF.h b/cppe/src/IceE/ReferenceFactoryF.h deleted file mode 100644 index 6ef45758d39..00000000000 --- a/cppe/src/IceE/ReferenceFactoryF.h +++ /dev/null @@ -1,25 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_REFERENCE_FACTORY_F_H -#define ICEE_REFERENCE_FACTORY_F_H - -#include <IceE/Handle.h> -#include <IceE/Shared.h> - -namespace IceInternal -{ - -class ReferenceFactory; -IceUtil::Shared* upCast(ReferenceFactory*); -typedef Handle<ReferenceFactory> ReferenceFactoryPtr; - -} - -#endif diff --git a/cppe/src/IceE/ReplyStatus.h b/cppe/src/IceE/ReplyStatus.h deleted file mode 100644 index 337c6cb0408..00000000000 --- a/cppe/src/IceE/ReplyStatus.h +++ /dev/null @@ -1,29 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_REPLY_STATUS_H -#define ICEE_REPLY_STATUS_H - -#include <IceE/Config.h> - -namespace IceInternal -{ - -static const Ice::Byte replyOK = 0; -static const Ice::Byte replyUserException = 1; -static const Ice::Byte replyObjectNotExist = 2; -static const Ice::Byte replyFacetNotExist = 3; -static const Ice::Byte replyOperationNotExist = 4; -static const Ice::Byte replyUnknownLocalException = 5; -static const Ice::Byte replyUnknownUserException = 6; -static const Ice::Byte replyUnknownException = 7; - -} - -#endif diff --git a/cppe/src/IceE/RouterInfo.cpp b/cppe/src/IceE/RouterInfo.cpp deleted file mode 100644 index 8a864dfbcad..00000000000 --- a/cppe/src/IceE/RouterInfo.cpp +++ /dev/null @@ -1,263 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Config.h> - -#ifdef ICEE_HAS_ROUTER - -#include <IceE/RouterInfo.h> -#include <IceE/Router.h> -#include <IceE/Reference.h> -#include <IceE/LocalException.h> -#include <IceE/Connection.h> // For ice_getConnection()->timeout(). -#include <IceE/Functional.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(RouterManager* p) { return p; } -IceUtil::Shared* IceInternal::upCast(RouterInfo* p) { return p; } - -IceInternal::RouterManager::RouterManager() : - _tableHint(_table.end()) -{ -} - -void -IceInternal::RouterManager::destroy() -{ - IceUtil::Mutex::Lock sync(*this); - - for_each(_table.begin(), _table.end(), Ice::secondVoidMemFun<const RouterPrx, RouterInfo>(&RouterInfo::destroy)); - - _table.clear(); - _tableHint = _table.end(); -} - -RouterInfoPtr -IceInternal::RouterManager::get(const RouterPrx& rtr) -{ - if(!rtr) - { - return 0; - } - - RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed. - - IceUtil::Mutex::Lock sync(*this); - - map<RouterPrx, RouterInfoPtr>::iterator p = _table.end(); - - if(_tableHint != _table.end()) - { - if(_tableHint->first == router) - { - p = _tableHint; - } - } - - if(p == _table.end()) - { - p = _table.find(router); - } - - if(p == _table.end()) - { - _tableHint = _table.insert(_tableHint, pair<const RouterPrx, RouterInfoPtr>(router, new RouterInfo(router))); - } - else - { - _tableHint = p; - } - - return _tableHint->second; -} - -RouterInfoPtr -IceInternal::RouterManager::erase(const RouterPrx& rtr) -{ - RouterInfoPtr info; - if(rtr) - { - RouterPrx router = RouterPrx::uncheckedCast(rtr->ice_router(0)); // The router cannot be routed. - IceUtil::Mutex::Lock sync(*this); - - map<RouterPrx, RouterInfoPtr>::iterator p = _table.end(); - if(_tableHint != _table.end() && _tableHint->first == router) - { - p = _tableHint; - _tableHint = _table.end(); - } - - if(p == _table.end()) - { - p = _table.find(router); - } - - if(p != _table.end()) - { - info = p->second; - _table.erase(p); - } - } - - return info; -} - -IceInternal::RouterInfo::RouterInfo(const RouterPrx& router) : - _router(router) -{ - assert(_router); -} - -void -IceInternal::RouterInfo::destroy() -{ - IceUtil::Mutex::Lock sync(*this); - - _clientEndpoints.clear(); - _serverEndpoints.clear(); -#ifndef ICEE_PURE_CLIENT - _adapter = 0; -#endif - _identities.clear(); -} - -bool -IceInternal::RouterInfo::operator==(const RouterInfo& rhs) const -{ - return _router == rhs._router; -} - -bool -IceInternal::RouterInfo::operator!=(const RouterInfo& rhs) const -{ - return _router != rhs._router; -} - -bool -IceInternal::RouterInfo::operator<(const RouterInfo& rhs) const -{ - return _router < rhs._router; -} - -RouterPrx -IceInternal::RouterInfo::getRouter() const -{ - // - // No mutex lock necessary, _router is immutable. - // - return _router; -} - -vector<EndpointPtr> -IceInternal::RouterInfo::getClientEndpoints() -{ - IceUtil::Mutex::Lock sync(*this); - - if(_clientEndpoints.size() == 0) // Lazy initialization. - { - ObjectPrx clientProxy = _router->getClientProxy(); - if(!clientProxy) - { - // - // If getClientProxy() return nil, use router endpoints. - // - _clientEndpoints = _router->__reference()->getEndpoints(); - } - else - { - clientProxy = clientProxy->ice_router(0); // The client proxy cannot be routed. - - // - // In order to avoid creating a new connection to the router, - // we must use the same timeout as the already existing - // connection. - // - clientProxy = clientProxy->ice_timeout(_router->ice_getConnection()->timeout()); - - _clientEndpoints = clientProxy->__reference()->getEndpoints(); - } - } - - return _clientEndpoints; -} - -vector<EndpointPtr> -IceInternal::RouterInfo::getServerEndpoints() -{ - IceUtil::Mutex::Lock sync(*this); - - if(_serverEndpoints.size() == 0) // Lazy initialization. - { - ObjectPrx serverProxy = _router->getServerProxy(); - if(!serverProxy) - { - throw NoEndpointException(__FILE__, __LINE__); - } - - serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed. - - _serverEndpoints = serverProxy->__reference()->getEndpoints(); - } - - return _serverEndpoints; -} - -void -IceInternal::RouterInfo::addProxy(const ObjectPrx& proxy) -{ - assert(proxy); // Must not be called for null proxies. - - IceUtil::Mutex::Lock sync(*this); - - set<Identity>::iterator p = _identities.find(proxy->ice_getIdentity()); - - if(p == _identities.end()) - { - // - // Only add the proxy to the router if it's not already in our local map. - // - ObjectProxySeq proxies; - proxies.push_back(proxy); - ObjectProxySeq evictedProxies = _router->addProxies(proxies); - - // - // If we successfully added the proxy to the router, we add it to our local map. - // - _identities.insert(_identities.begin(), proxy->ice_getIdentity()); - - // - // We also must remove whatever proxies the router evicted. - // - for(ObjectProxySeq::iterator q = evictedProxies.begin(); q != evictedProxies.end(); ++q) - { - _identities.erase((*q)->ice_getIdentity()); - } - } -} - -#ifndef ICEE_PURE_CLIENT -void -IceInternal::RouterInfo::setAdapter(const ObjectAdapterPtr& adapter) -{ - IceUtil::Mutex::Lock sync(*this); - _adapter = adapter; -} - -ObjectAdapterPtr -IceInternal::RouterInfo::getAdapter() const -{ - IceUtil::Mutex::Lock sync(*this); - return _adapter; -} -#endif - -#endif diff --git a/cppe/src/IceE/RouterInfo.h b/cppe/src/IceE/RouterInfo.h deleted file mode 100644 index 49372c1c6d5..00000000000 --- a/cppe/src/IceE/RouterInfo.h +++ /dev/null @@ -1,88 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_ROUTER_INFO_H -#define ICEE_ROUTER_INFO_H - -#include <IceE/Config.h> - -#ifdef ICEE_HAS_ROUTER - -#include <IceE/RouterInfoF.h> -#include <IceE/RouterF.h> -#ifndef ICEE_PURE_CLIENT -# include <IceE/ObjectAdapterF.h> -#endif -#include <IceE/EndpointF.h> -#include <IceE/Shared.h> -#include <IceE/Mutex.h> - -#include <set> - -namespace IceInternal -{ - -class RouterManager : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - RouterManager(); - - void destroy(); - - // - // Returns router info for a given router. Automatically creates - // the router info if it doesn't exist yet. - // - RouterInfoPtr get(const Ice::RouterPrx&); - RouterInfoPtr erase(const Ice::RouterPrx&); - -private: - - std::map<Ice::RouterPrx, RouterInfoPtr> _table; - std::map<Ice::RouterPrx, RouterInfoPtr>::iterator _tableHint; -}; - -class RouterInfo : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - RouterInfo(const Ice::RouterPrx&); - - void destroy(); - - bool operator==(const RouterInfo&) const; - bool operator!=(const RouterInfo&) const; - bool operator<(const RouterInfo&) const; - - Ice::RouterPrx getRouter() const; - std::vector<IceInternal::EndpointPtr> getClientEndpoints(); - std::vector<IceInternal::EndpointPtr> getServerEndpoints(); - void addProxy(const Ice::ObjectPrx&); -#ifndef ICEE_PURE_CLIENT - void setAdapter(const Ice::ObjectAdapterPtr&); - Ice::ObjectAdapterPtr getAdapter() const; -#endif - -private: - - const Ice::RouterPrx _router; - std::vector<IceInternal::EndpointPtr> _clientEndpoints; - std::vector<IceInternal::EndpointPtr> _serverEndpoints; -#ifndef ICEE_PURE_CLIENT - Ice::ObjectAdapterPtr _adapter; -#endif - std::set<Ice::Identity> _identities; -}; - -} - -#endif - -#endif diff --git a/cppe/src/IceE/SafeStdio.cpp b/cppe/src/IceE/SafeStdio.cpp deleted file mode 100644 index b4bfc96e6cf..00000000000 --- a/cppe/src/IceE/SafeStdio.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/SafeStdio.h> -#include <stdarg.h> -#include <stdio.h> - -using namespace std; - -string -Ice::printfToString(const char* fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - char buf[1024]; -#if defined(_WIN32) - _vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#else - vsnprintf(buf, sizeof(buf)-1, fmt, ap); -#endif - buf[sizeof(buf)-1] = '\0'; - va_end(ap); - - return buf; -} - diff --git a/cppe/src/IceE/ServantManager.cpp b/cppe/src/IceE/ServantManager.cpp deleted file mode 100644 index 776ebf23aff..00000000000 --- a/cppe/src/IceE/ServantManager.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ServantManager.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/StringUtil.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(ServantManager* p) { return p; } - -void -IceInternal::ServantManager::addServant(const ObjectPtr& object, const Identity& ident, const string& facet) -{ - IceUtil::Mutex::Lock sync(*this); - - assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - - if(p == _servantMapMap.end() || p->first != ident) - { - p = _servantMapMap.find(ident); - } - - if(p == _servantMapMap.end()) - { - p = _servantMapMap.insert(_servantMapMapHint, pair<const Identity, FacetMap>(ident, FacetMap())); - } - else - { - if(p->second.find(facet) != p->second.end()) - { - AlreadyRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "servant"; - ex.id = _instance->identityToString(ident); - if(!facet.empty()) - { - ex.id += " -f " + IceUtil::escapeString(facet, ""); - } - throw ex; - } - } - - _servantMapMapHint = p; - - p->second.insert(pair<const string, ObjectPtr>(facet, object)); -} - -ObjectPtr -IceInternal::ServantManager::removeServant(const Identity& ident, const string& facet) -{ - // - // We return the removed servant to avoid releasing the last reference count - // with *this locked. We don't want to run user code, such as the servant - // destructor, with an internal Ice mutex locked. - // - ObjectPtr servant = 0; - - IceUtil::Mutex::Lock sync(*this); - - assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - FacetMap::iterator q; - - if(p == _servantMapMap.end() || p->first != ident) - { - p = _servantMapMap.find(ident); - } - - if(p == _servantMapMap.end() || (q = p->second.find(facet)) == p->second.end()) - { - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "servant"; - ex.id = _instance->identityToString(ident); - if(!facet.empty()) - { - ex.id += " -f " + IceUtil::escapeString(facet, ""); - } - throw ex; - } - - servant = q->second; - p->second.erase(q); - - if(p->second.empty()) - { - if(p == _servantMapMapHint) - { - _servantMapMap.erase(p++); - _servantMapMapHint = p; - } - else - { - _servantMapMap.erase(p); - } - } - return servant; -} - -FacetMap -IceInternal::ServantManager::removeAllFacets(const Identity& ident) -{ - IceUtil::Mutex::Lock sync(*this); - - assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - - if(p == _servantMapMap.end() || p->first != ident) - { - p = _servantMapMap.find(ident); - } - - if(p == _servantMapMap.end()) - { - NotRegisteredException ex(__FILE__, __LINE__); - ex.kindOfObject = "servant"; - ex.id = _instance->identityToString(ident); - throw ex; - } - - FacetMap result = p->second; - - if(p == _servantMapMapHint) - { - _servantMapMap.erase(p++); - _servantMapMapHint = p; - } - else - { - _servantMapMap.erase(p); - } - - return result; -} - -ObjectPtr -IceInternal::ServantManager::findServant(const Identity& ident, const string& facet) const -{ - IceUtil::Mutex::Lock sync(*this); - - // - // This assert is not valid if the adapter dispatch incoming - // requests from bidir connections. This method might be called if - // requests are received over the bidir connection after the - // adapter was deactivated. - // - //assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - FacetMap::iterator q; - - ServantMapMap& servantMapMap = const_cast<ServantMapMap&>(_servantMapMap); - - if(p == servantMapMap.end() || p->first != ident) - { - p = servantMapMap.find(ident); - } - - if(p == servantMapMap.end() || (q = p->second.find(facet)) == p->second.end()) - { - return 0; - } - else - { - _servantMapMapHint = p; - return q->second; - } -} - -FacetMap -IceInternal::ServantManager::findAllFacets(const Identity& ident) const -{ - IceUtil::Mutex::Lock sync(*this); - - assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - - ServantMapMap& servantMapMap = const_cast<ServantMapMap&>(_servantMapMap); - - if(p == servantMapMap.end() || p->first != ident) - { - p = servantMapMap.find(ident); - } - - if(p == servantMapMap.end()) - { - return FacetMap(); - } - else - { - _servantMapMapHint = p; - return p->second; - } -} - -bool -IceInternal::ServantManager::hasServant(const Identity& ident) const -{ - IceUtil::Mutex::Lock sync(*this); - - // - // This assert is not valid if the adapter dispatch incoming - // requests from bidir connections. This method might be called if - // requests are received over the bidir connection after the - // adapter was deactivated. - // - //assert(_instance); // Must not be called after destruction. - - ServantMapMap::iterator p = _servantMapMapHint; - ServantMapMap& servantMapMap = const_cast<ServantMapMap&>(_servantMapMap); - - if(p == servantMapMap.end() || p->first != ident) - { - p = servantMapMap.find(ident); - } - - if(p == servantMapMap.end()) - { - return false; - } - else - { - _servantMapMapHint = p; - assert(!p->second.empty()); - return true; - } -} - -IceInternal::ServantManager::ServantManager(const InstancePtr& instance, const string& adapterName) - : _instance(instance), - _adapterName(adapterName), - _servantMapMapHint(_servantMapMap.end()) -{ -} - -IceInternal::ServantManager::~ServantManager() -{ - // - // Don't check whether destroy() has been called. It might have - // not been called if the associated object adapter was not - // properly deactivated. - // - //assert(!_instance); -} - -void -IceInternal::ServantManager::destroy() -{ - ServantMapMap servantMapMap; - - { - IceUtil::Mutex::Lock sync(*this); - - assert(_instance); // Must not be called after destruction. - - servantMapMap.swap(_servantMapMap); - _servantMapMapHint = _servantMapMap.end(); - - _instance = 0; - } - - // - // We clear the maps outside the synchronization as we don't want to - // hold any internal Ice mutex while running user code (such as servant - // or servant locator destructors). - // - servantMapMap.clear(); -} diff --git a/cppe/src/IceE/ServantManager.h b/cppe/src/IceE/ServantManager.h deleted file mode 100644 index 617e4c22abb..00000000000 --- a/cppe/src/IceE/ServantManager.h +++ /dev/null @@ -1,53 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_SERVANT_MANAGER_H -#define ICEE_SERVANT_MANAGER_H - -#include <IceE/ServantManagerF.h> -#include <IceE/InstanceF.h> -#include <IceE/ObjectAdapter.h> -#include <IceE/Shared.h> -#include <IceE/Mutex.h> -#include <IceE/Identity.h> - -namespace IceInternal -{ - -class ServantManager : public IceUtil::Shared, public IceUtil::Mutex -{ -public: - - void addServant(const Ice::ObjectPtr&, const Ice::Identity&, const std::string&); - Ice::ObjectPtr removeServant(const Ice::Identity&, const std::string&); - Ice::FacetMap removeAllFacets(const Ice::Identity&); - Ice::ObjectPtr findServant(const Ice::Identity&, const std::string&) const; - Ice::FacetMap findAllFacets(const Ice::Identity&) const; - bool hasServant(const Ice::Identity&) const; - -private: - - ServantManager(const InstancePtr&, const std::string&); - ~ServantManager(); - void destroy(); - friend class Ice::ObjectAdapter; - - InstancePtr _instance; - - const std::string _adapterName; - - typedef std::map<Ice::Identity, Ice::FacetMap> ServantMapMap; - - ServantMapMap _servantMapMap; - mutable ServantMapMap::iterator _servantMapMapHint; -}; - -} - -#endif diff --git a/cppe/src/IceE/Shared.cpp b/cppe/src/IceE/Shared.cpp deleted file mode 100644 index bfb7ce40ab0..00000000000 --- a/cppe/src/IceE/Shared.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Shared.h> - -using namespace Ice; - -IceUtil::SimpleShared::SimpleShared() : - _ref(0), - _noDelete(false) -{ -} - -IceUtil::SimpleShared::SimpleShared(const SimpleShared&) : - _ref(0), - _noDelete(false) -{ -} - -IceUtil::Shared::Shared() : -#ifndef ICEE_HAS_ATOMIC_FUNCTIONS - _ref(0), -#endif - _noDelete(false) -{ -#ifdef ICEE_HAS_ATOMIC_FUNCTIONS - ice_atomic_set(&_ref, 0); -#endif -} - -IceUtil::Shared::Shared(const Shared&) : -#ifndef ICEE_HAS_ATOMIC_FUNCTIONS - _ref(0), -#endif - _noDelete(false) -{ -#ifdef ICEE_HAS_ATOMIC_FUNCTIONS - ice_atomic_set(&_ref, 0); -#endif -} - -int -IceUtil::Shared::__getRef() const -{ -#if defined(_WIN32) - return InterlockedExchangeAdd(const_cast<LONG*>(&_ref), 0); -#elif defined(ICEE_HAS_ATOMIC_FUNCTIONS) - return ice_atomic_exchange_add(0, const_cast<ice_atomic_t*>(&_ref)); -#else - _mutex.lock(); - int ref = _ref; - _mutex.unlock(); - return ref; -#endif -} - -void -IceUtil::Shared::__setNoDelete(bool b) -{ - _noDelete = b; -} diff --git a/cppe/src/IceE/StaticMutex.cpp b/cppe/src/IceE/StaticMutex.cpp deleted file mode 100644 index 334ea1ae99d..00000000000 --- a/cppe/src/IceE/StaticMutex.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/StaticMutex.h> - -#ifdef _WIN32 -void IceUtil::StaticMutex::initialize() const -{ - // - // First we create the new critical section - // - CRITICAL_SECTION* newCriticalSection = new CRITICAL_SECTION; - InitializeCriticalSection(newCriticalSection); - - // - // Then assign it to _mutex - // Note that Windows performs a full memory barrier before the assignment; - // this ensures we write the initialized critical section before we write _mutex. - // - if(InterlockedCompareExchangePointer(reinterpret_cast<void**>(&_mutex), newCriticalSection, 0) != 0) - { - // - // Another thread was doing the same thing - // - DeleteCriticalSection(newCriticalSection); - delete newCriticalSection; - } - - // - // This implementation does not attempt to clean up the initialized and assigned critical sections: - // they leak - // -} -#endif - -IceUtil::StaticMutex IceUtil::globalMutex = ICE_STATIC_MUTEX_INITIALIZER; diff --git a/cppe/src/IceE/StringConverter.cpp b/cppe/src/IceE/StringConverter.cpp deleted file mode 100644 index 2ef75cea5b5..00000000000 --- a/cppe/src/IceE/StringConverter.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Config.h> - -#ifdef ICEE_HAS_WSTRING - -#include <IceE/StringConverter.h> -#include <IceE/Unicode.h> -#include <IceE/LocalException.h> - -using namespace IceUtil; -using namespace std; - -namespace Ice -{ - -Byte* -UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart, - const wchar_t* sourceEnd, - UTF8Buffer& buffer) const -{ - // - // The "chunk size" is the maximum of the number of characters in the - // source and 6 (== max bytes necessary to encode one Unicode character). - // - size_t chunkSize = std::max<size_t>(static_cast<size_t>(sourceEnd - sourceStart), 6); - - Byte* targetStart = buffer.getMoreBytes(chunkSize, 0); - Byte* targetEnd = targetStart + chunkSize; - - ConversionResult result; - - while((result = - convertUTFWstringToUTF8(sourceStart, sourceEnd, - targetStart, targetEnd, lenientConversion)) - == targetExhausted) - { - targetStart = buffer.getMoreBytes(chunkSize, targetStart); - targetEnd = targetStart + chunkSize; - } - - switch(result) - { - case conversionOK: - break; - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "wide string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } - } - return targetStart; -} - -void -UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - wstring& target) const -{ - ConversionResult result = - convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion); - - switch(result) - { - case conversionOK: - break; - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } - } -} - -} - -#endif diff --git a/cppe/src/IceE/StringUtil.cpp b/cppe/src/IceE/StringUtil.cpp deleted file mode 100644 index 1a797592071..00000000000 --- a/cppe/src/IceE/StringUtil.cpp +++ /dev/null @@ -1,403 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/StringUtil.h> -#include <IceE/ExceptionBase.h> - -using namespace std; -using namespace IceUtil; - -static string -toOctalString(unsigned int n) -{ - string s; - s.resize(32); - string::size_type charPos = 32; - const int radix = 1 << 3; - int mask = radix - 1; - do - { - s[--charPos] = '0' + (n & mask); - n >>= 3; - } - while(n != 0); - - return string(s, charPos, (32 - charPos)); -} - -// -// Write the byte b as an escape sequence if it isn't a printable ASCII -// character and append the escape sequence to s. Additional characters -// that should be escaped can be passed in special. If b is any of these -// characters, b is preceded by a backslash in s. -// -static void -encodeChar(string::value_type b, string& s, const string& special) -{ - switch(b) - { - case '\\': - { - s.append("\\\\"); - break; - } - - case '\'': - { - s.append("\\'"); - break; - } - - case '"': - { - s.append("\\\""); - break; - } - - case '\b': - { - s.append("\\b"); - break; - } - - case '\f': - { - s.append("\\f"); - break; - } - - case '\n': - { - s.append("\\n"); - break; - } - - case '\r': - { - s.append("\\r"); - break; - } - - case '\t': - { - s.append("\\t"); - break; - } - - default: - { - unsigned char i = static_cast<unsigned char>(b); - if(!(i >= 32 && i <= 126)) - { - s.push_back('\\'); - string octal = toOctalString(i); - // - // Add leading zeroes so that we avoid problems during - // decoding. For example, consider the escaped string - // \0013 (i.e., a character with value 1 followed by the - // character '3'). If the leading zeroes were omitted, the - // result would be incorrectly interpreted as a single - // character with value 11. - // - for(string::size_type j = octal.size(); j < 3; j++) - { - s.push_back('0'); - } - s.append(octal); - } - else if(special.find(b) != string::npos) - { - s.push_back('\\'); - s.push_back(b); - } - else - { - s.push_back(b); - } - break; - } - } -} - -// -// Add escape sequences (such as "\n", or "\007") to make a string -// readable in ASCII. Any characters that appear in special are -// prefixed with a backslash in the returned string. -// -string -IceUtil::escapeString(const string& s, const string& special) -{ - string::size_type i; - for(i = 0; i < special.size(); ++i) - { - if(static_cast<unsigned char>(special[i]) < 32 || static_cast<unsigned char>(special[i]) > 126) - { - throw IllegalArgumentException(__FILE__, __LINE__, "special characters must be in ASCII range 32-126"); - } - } - - string result; - for(i = 0; i < s.size(); ++i) - { - encodeChar(s[i], result, special); - } - - return result; -} - -static char -checkChar(char c) -{ - if(!(static_cast<unsigned char>(c) >= 32 && static_cast<unsigned char>(c) <= 126)) - { - throw IllegalArgumentException(__FILE__, __LINE__, "illegal input character"); - } - return c; -} - -// -// Decode the character or escape sequence starting at start and return it. -// end marks the one-past-the-end position of the substring to be scanned. -// nextStart is set to the index of the first character following the decoded -// character or escape sequence. -// -static char -decodeChar(const string& s, string::size_type start, string::size_type end, string::size_type& nextStart) -{ - assert(start >= 0); - assert(start < end); - assert(end <= s.size()); - - char c; - - if(s[start] != '\\') - { - c = checkChar(s[start++]); - } - else - { - if(start + 1 == end) - { - throw IllegalArgumentException(__FILE__, __LINE__, "trailing backslash in argument"); - } - switch(s[++start]) - { - case '\\': - case '\'': - case '"': - { - c = s[start++]; - break; - } - case 'b': - { - ++start; - c = '\b'; - break; - } - case 'f': - { - ++start; - c = '\f'; - break; - } - case 'n': - { - ++start; - c = '\n'; - break; - } - case 'r': - { - ++start; - c = '\r'; - break; - } - case 't': - { - ++start; - c = '\t'; - break; - } - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { - int oct = 0; - for(int j = 0; j < 3 && start < end; ++j) - { - int charVal = s[start++] - '0'; - if(charVal < 0 || charVal > 7) - { - --start; - break; - } - oct = oct * 8 + charVal; - } - if(oct > 255) - { - throw IllegalArgumentException(__FILE__, __LINE__, "octal value out of range"); - } - c = (char)oct; - break; - } - default: - { - c = checkChar(s[start++]); - break; - } - } - } - nextStart = start; - return c; -} - -// -// Remove escape sequences from s and append the result to sb. -// Return true if successful, false otherwise. -// -static void decodeString(const string& s, string::size_type start, string::size_type end, string& sb) -{ - while(start < end) - { - sb.push_back(decodeChar(s, start, end, start)); - } -} - -// -// Remove escape sequences added by escapeString. -// -bool -IceUtil::unescapeString(const string& s, string::size_type start, string::size_type end, string& result) -{ - if(start < 0) - { - throw IllegalArgumentException(__FILE__, __LINE__, "start offset must be >= 0"); - } - if(end > s.size()) - { - throw IllegalArgumentException(__FILE__, __LINE__, "end offset must be <= s.size()"); - } - if(start > end) - { - throw IllegalArgumentException(__FILE__, __LINE__, "start offset must <= end offset"); - } - - result.reserve(end - start); - - try - { - result.clear(); - decodeString(s, start, end, result); - return true; - } - catch(...) - { - return false; - } -} - -// -// Trim white space (" \t\r\n") -// -string -IceUtil::trim(const string& s) -{ - const string delim = " \t\r\n"; - if(s.length() != 0) - { - string::size_type beg = s.find_first_not_of(delim); - string::size_type end = s.find_last_not_of(delim); - return s.substr(beg, end - beg + 1); - } - return s; -} - -// -// If a single or double quotation mark is found at the start position, -// then the position of the matching closing quote is returned. If no -// quotation mark is found at the start position, then 0 is returned. -// If no matching closing quote is found, then -1 is returned. -// -string::size_type -IceUtil::checkQuote(const string& s, string::size_type start) -{ - string::value_type quoteChar = s[start]; - if(quoteChar == '"' || quoteChar == '\'') - { - start++; - string::size_type pos; - while(start < s.size() && (pos = s.find(quoteChar, start)) != string::npos) - { - if(s[pos - 1] != '\\') - { - return pos; - } - start = pos + 1; - } - return string::npos; // Unmatched quote. - } - return 0; // Not quoted. -} - -// -// Match `s' against the pattern `pat'. A * in the pattern acts -// as a wildcard: it matches any non-empty sequence of characters -// other than a period (`.'). We match by hand here because -// it's portable across platforms (whereas regex() isn't). -// -bool -IceUtil::match(const string& s, const string& pat, bool matchPeriod) -{ - assert(!s.empty()); - assert(!pat.empty()); - - if(pat.find('*') == string::npos) - { - return s == pat; - } - - string::size_type sIndex = 0; - string::size_type patIndex = 0; - do - { - if(pat[patIndex] == '*') - { - // - // Don't allow matching x..y against x.*.y if requested -- star matches non-empty sequence only. - // - if(!matchPeriod && s[sIndex] == '.') - { - return false; - } - while(sIndex < s.size() && (matchPeriod || s[sIndex] != '.')) - { - ++sIndex; - } - patIndex++; - } - else - { - if(pat[patIndex] != s[sIndex]) - { - return false; - } - ++sIndex; - ++patIndex; - } - } - while(sIndex < s.size() && patIndex < pat.size()); - - return sIndex == s.size() && patIndex == pat.size(); -} diff --git a/cppe/src/IceE/Thread.cpp b/cppe/src/IceE/Thread.cpp deleted file mode 100644 index 4521f9ee7ca..00000000000 --- a/cppe/src/IceE/Thread.cpp +++ /dev/null @@ -1,488 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Thread.h> -#include <IceE/Time.h> -#include <IceE/ThreadException.h> - -#include <stdio.h> - -#ifdef _WIN32 - -IceUtil::ThreadControl::ThreadControl() : - _handle(0), - _id(GetCurrentThreadId()) -{ -} - -IceUtil::ThreadControl::ThreadControl(HANDLE handle, IceUtil::ThreadControl::ID id) : - _handle(handle), - _id(id) -{ -} - -bool -IceUtil::ThreadControl::operator==(const ThreadControl& rhs) const -{ - return _id == rhs._id; -} - -bool -IceUtil::ThreadControl::operator!=(const ThreadControl& rhs) const -{ - return _id != rhs._id; -} - -void -IceUtil::ThreadControl::join() -{ - if(_handle == 0) - { - throw BadThreadControlException(__FILE__, __LINE__); - } - - int rc = WaitForSingleObject(_handle, INFINITE); - if(rc != WAIT_OBJECT_0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - - detach(); -} - -void -IceUtil::ThreadControl::detach() -{ - if(_handle == 0) - { - throw BadThreadControlException(__FILE__, __LINE__); - } - - if(CloseHandle(_handle) == 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } -} - -IceUtil::ThreadControl::ID -IceUtil::ThreadControl::id() const -{ - return _id; -} - -void -IceUtil::ThreadControl::sleep(const Time& timeout) -{ - Sleep(static_cast<long>(timeout.toMilliSeconds())); -} - -void -IceUtil::ThreadControl::yield() -{ - // - // A value of zero causes the thread to relinquish the remainder - // of its time slice to any other thread of equal priority that is - // ready to run. - // - Sleep(0); -} - -IceUtil::Thread::Thread() : - _started(false), - _running(false), - _handle(0), - _id(0) -{ -} - -IceUtil::Thread::~Thread() -{ -} - - -#ifdef _WIN32_WCE -static DWORD -#else -static unsigned int -#endif -WINAPI startHook(void* arg) -{ - // Ensure that the thread doesn't go away until run() has - // completed. - // - IceUtil::ThreadPtr thread; - - try - { - IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg); - - // - // Initialize the random number generator in each thread. - // - unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds()); - srand(seed); - - // - // Ensure that the thread doesn't go away until run() has - // completed. - // - thread = rawThread; - - // - // See the comment in IceUtil::Thread::start() for details. - // - rawThread->__decRef(); - thread->run(); - } - catch(const IceUtil::Exception& e) - { - fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str()); - } - catch(...) - { - fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n"); - } - thread->_done(); - - return 0; -} - -#ifndef _WIN32_WCE -# include <process.h> -#endif - -IceUtil::ThreadControl -IceUtil::Thread::start(size_t stackSize) -{ - // - // Keep this alive for the duration of start - // - IceUtil::ThreadPtr keepMe = this; - - IceUtil::Mutex::Lock lock(_stateMutex); - - if(_started) - { - throw ThreadStartedException(__FILE__, __LINE__); - } - - // - // It's necessary to increment the reference count since - // pthread_create won't necessarily call the thread function until - // later. If the user does (new MyThread)->start() then the thread - // object could be deleted before the thread object takes - // ownership. It's also necessary to increment the reference count - // prior to calling pthread_create since the thread itself calls - // __decRef(). - // - __incRef(); - -#ifdef _WIN32_WCE - _handle = CreateThread(0, stackSize, - startHook, this, 0, &_id); -#else - unsigned int id; - _handle = - reinterpret_cast<HANDLE>( - _beginthreadex(0, - static_cast<unsigned int>(stackSize), - startHook, this, 0, &id)); - _id = id; -#endif - - if(_handle == 0) - { - __decRef(); - throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); - } - - _started = true; - _running = true; - - return ThreadControl(_handle, _id); -} - -IceUtil::ThreadControl -IceUtil::Thread::getThreadControl() const -{ - IceUtil::Mutex::Lock lock(_stateMutex); - if(!_started) - { - throw ThreadNotStartedException(__FILE__, __LINE__); - } - return ThreadControl(_handle, _id); -} - -bool -IceUtil::Thread::operator==(const Thread& rhs) const -{ - return this == &rhs; -} - -bool -IceUtil::Thread::operator!=(const Thread& rhs) const -{ - return this != &rhs; -} - -bool -IceUtil::Thread::operator<(const Thread& rhs) const -{ - return this < &rhs; -} - -bool -IceUtil::Thread::isAlive() const -{ - IceUtil::Mutex::Lock lock(_stateMutex); - return _running; -} - -void -IceUtil::Thread::_done() -{ - IceUtil::Mutex::Lock lock(_stateMutex); - _running = false; -} - - -#else - -IceUtil::ThreadControl::ThreadControl(pthread_t thread) : - _thread(thread), - _detachable(true) -{ -} - -IceUtil::ThreadControl::ThreadControl() : - _thread(pthread_self()), - _detachable(false) -{ -} - -bool -IceUtil::ThreadControl::operator==(const ThreadControl& rhs) const -{ - return pthread_equal(_thread, rhs._thread) != 0; -} - -bool -IceUtil::ThreadControl::operator!=(const ThreadControl& rhs) const -{ - return !operator==(rhs); -} - -void -IceUtil::ThreadControl::join() -{ - if(!_detachable) - { - throw BadThreadControlException(__FILE__, __LINE__); - } - - void* ignore = 0; - int rc = pthread_join(_thread, &ignore); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -} - -void -IceUtil::ThreadControl::detach() -{ - if(!_detachable) - { - throw BadThreadControlException(__FILE__, __LINE__); - } - - int rc = pthread_detach(_thread); - if(rc != 0) - { - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } -} - -IceUtil::ThreadControl::ID -IceUtil::ThreadControl::id() const -{ - return _thread;; -} - -void -IceUtil::ThreadControl::sleep(const Time& timeout) -{ - struct timeval tv = timeout; - struct timespec ts; - ts.tv_sec = tv.tv_sec; - ts.tv_nsec = tv.tv_usec * 1000L; - nanosleep(&ts, 0); -} - -void -IceUtil::ThreadControl::yield() -{ - sched_yield(); -} - -IceUtil::Thread::Thread() : - _started(false), - _running(false) -{ -} - -IceUtil::Thread::~Thread() -{ -} - -extern "C" -{ -static void* -startHook(void* arg) -{ - // - // Ensure that the thread doesn't go away until run() has - // completed. - // - IceUtil::ThreadPtr thread; - - try - { - IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg); - - thread = rawThread; - - // - // See the comment in IceUtil::Thread::start() for details. - // - rawThread->__decRef(); - thread->run(); - } - catch(const IceUtil::Exception& e) - { - fprintf(stderr, "IceUtil::Thread::run(): uncaught exception: %s\n", e.toString().c_str()); - } - catch(...) - { - fprintf(stderr, "IceUtil::Thread::run(): uncaught exception\n"); - } - thread->_done(); - - return 0; -} -} - -IceUtil::ThreadControl -IceUtil::Thread::start(size_t stackSize) -{ - // - // Keep this alive for the duration of start - // - IceUtil::ThreadPtr keepMe = this; - - IceUtil::Mutex::Lock lock(_stateMutex); - - if(_started) - { - throw ThreadStartedException(__FILE__, __LINE__); - } - - // - // It's necessary to increment the reference count since - // pthread_create won't necessarily call the thread function until - // later. If the user does (new MyThread)->start() then the thread - // object could be deleted before the thread object takes - // ownership. It's also necessary to increment the reference count - // prior to calling pthread_create since the thread itself calls - // __decRef(). - // - __incRef(); - - if(stackSize > 0) - { - pthread_attr_t attr; - int rc = pthread_attr_init(&attr); - if(rc != 0) - { - __decRef(); - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - rc = pthread_attr_setstacksize(&attr, stackSize); - if(rc != 0) - { - __decRef(); - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - rc = pthread_create(&_thread, &attr, startHook, this); - if(rc != 0) - { - __decRef(); - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - } - else - { - int rc = pthread_create(&_thread, 0, startHook, this); - if(rc != 0) - { - __decRef(); - throw ThreadSyscallException(__FILE__, __LINE__, rc); - } - } - - _started = true; - _running = true; - - return ThreadControl(_thread); -} - -IceUtil::ThreadControl -IceUtil::Thread::getThreadControl() const -{ - IceUtil::Mutex::Lock lock(_stateMutex); - if(!_started) - { - throw ThreadNotStartedException(__FILE__, __LINE__); - } - return ThreadControl(_thread); -} - -bool -IceUtil::Thread::operator==(const Thread& rhs) const -{ - return this == &rhs; -} - -bool -IceUtil::Thread::operator!=(const Thread& rhs) const -{ - return this != &rhs; -} - -bool -IceUtil::Thread::operator<(const Thread& rhs) const -{ - return this < &rhs; -} - -bool -IceUtil::Thread::isAlive() const -{ - IceUtil::Mutex::Lock lock(_stateMutex); - return _running; -} - -void -IceUtil::Thread::_done() -{ - IceUtil::Mutex::Lock lock(_stateMutex); - _running = false; -} - -#endif diff --git a/cppe/src/IceE/ThreadException.cpp b/cppe/src/IceE/ThreadException.cpp deleted file mode 100644 index 11eed016525..00000000000 --- a/cppe/src/IceE/ThreadException.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/ThreadException.h> -#include <IceE/SafeStdio.h> - -using namespace std; - -IceUtil::ThreadSyscallException::ThreadSyscallException(const char* file, int line, int err ): - Exception(file, line), - _error(err) -{ -} - -const char* IceUtil::ThreadSyscallException::_name = "IceUtil::ThreadSyscallException"; - -string -IceUtil::ThreadSyscallException::ice_name() const -{ - return _name; -} - -string -IceUtil::ThreadSyscallException::toString() const -{ - string out = Exception::toString(); - if(_error != 0) - { - out += ":\nthread syscall exception: "; -#ifdef _WIN32_WCE - out += Ice::printfToString("thread error: %d", _error); -#elif defined(_WIN32) - LPVOID lpMsgBuf = 0; - DWORD ok = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - _error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPTSTR)&lpMsgBuf, - 0, - NULL); - - if(ok) - { - LPCTSTR msg = (LPCTSTR)lpMsgBuf; - assert(msg && strlen((char*)msg) > 0); - out += reinterpret_cast<const char*>(msg); - LocalFree(lpMsgBuf); - } - else - { - out += "unknown thread error: "; - out += Ice::printfToString("error=%d", _error); - } -#else - out += strerror(_error); -#endif - } - return out; -} - -IceUtil::Exception* -IceUtil::ThreadSyscallException::ice_clone() const -{ - return new ThreadSyscallException(*this); -} - -void -IceUtil::ThreadSyscallException::ice_throw() const -{ - throw *this; -} - -int -IceUtil::ThreadSyscallException::error() const -{ - return _error; -} - - -IceUtil::ThreadLockedException::ThreadLockedException(const char* file, int line) : - Exception(file, line) -{ -} - -const char* IceUtil::ThreadLockedException::_name = "IceUtil::ThreadLockedException"; - -string -IceUtil::ThreadLockedException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::ThreadLockedException::ice_clone() const -{ - return new ThreadLockedException(*this); -} - -void -IceUtil::ThreadLockedException::ice_throw() const -{ - throw *this; -} - -IceUtil::ThreadStartedException::ThreadStartedException(const char* file, int line) : - Exception(file, line) -{ -} - -const char* IceUtil::ThreadStartedException::_name = "IceUtil::ThreadStartedException"; - -string -IceUtil::ThreadStartedException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::ThreadStartedException::ice_clone() const -{ - return new ThreadStartedException(*this); -} - -void -IceUtil::ThreadStartedException::ice_throw() const -{ - throw *this; -} - -IceUtil::ThreadNotStartedException::ThreadNotStartedException(const char* file, int line) : - Exception(file, line) -{ -} - -const char* IceUtil::ThreadNotStartedException::_name = "IceUtil::ThreadNotStartedException"; - -string -IceUtil::ThreadNotStartedException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::ThreadNotStartedException::ice_clone() const -{ - return new ThreadNotStartedException(*this); -} - -void -IceUtil::ThreadNotStartedException::ice_throw() const -{ - throw *this; -} - -IceUtil::BadThreadControlException::BadThreadControlException(const char* file, int line) : - Exception(file, line) -{ -} - -const char* IceUtil::BadThreadControlException::_name = "IceUtil::BadThreadControlException"; - -string -IceUtil::BadThreadControlException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::BadThreadControlException::ice_clone() const -{ - return new BadThreadControlException(*this); -} - -void -IceUtil::BadThreadControlException::ice_throw() const -{ - throw *this; -} - diff --git a/cppe/src/IceE/Time.cpp b/cppe/src/IceE/Time.cpp deleted file mode 100644 index 4b512fab065..00000000000 --- a/cppe/src/IceE/Time.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/DisableWarnings.h> -#include <IceE/Time.h> - -#ifndef _WIN32_WCE -# if defined(_WIN32) -# include <sys/timeb.h> -# include <time.h> -# else -# include <sys/time.h> -# endif -#endif - -using namespace IceUtil; - -IceUtil::Time::Time() : - _usec(0) -{ -} - -Time -IceUtil::Time::now() -{ -#if defined(_WIN32_WCE) - // - // Note that GetTickCount returns the number of ms since the - // device was started. Time cannot be used to represent an - // absolute time on CE since GetLocalTime doesn't have millisecond - // resolution. - // - return Time(static_cast<Int64>(GetTickCount()) * 1000); -#elif defined(_WIN32) - struct _timeb tb; - _ftime(&tb); - return Time(tb.time * static_cast<Int64>(1000000) + tb.millitm * static_cast<Int64>(1000)); -#else - struct timeval tv; - gettimeofday(&tv, 0); - return Time(tv.tv_sec * static_cast<Int64>(1000000) + tv.tv_usec); -#endif -} - -Time -IceUtil::Time::seconds(Int64 t) -{ - return Time(t * static_cast<Int64>(1000000)); -} - -Time -IceUtil::Time::milliSeconds(Int64 t) -{ - return Time(t * static_cast<Int64>(1000)); -} - -Time -IceUtil::Time::microSeconds(Int64 t) -{ - return Time(t); -} - -#ifndef _WIN32 -IceUtil::Time::operator timeval() const -{ - timeval tv; - tv.tv_sec = static_cast<long>(_usec / 1000000); - tv.tv_usec = static_cast<long>(_usec % 1000000); - return tv; -} -#endif - -Int64 -IceUtil::Time::toSeconds() const -{ - return _usec / 1000000; -} - -Int64 -IceUtil::Time::toMilliSeconds() const -{ - return _usec / 1000; -} - -Int64 -IceUtil::Time::toMicroSeconds() const -{ - return _usec; -} - -double -IceUtil::Time::toSecondsDouble() const -{ - return _usec / 1000000.0; -} - -double -IceUtil::Time::toMilliSecondsDouble() const -{ - return _usec / 1000.0; -} - -double -IceUtil::Time::toMicroSecondsDouble() const -{ - return static_cast<double>(_usec); -} - -Time::Time(Int64 usec) : - _usec(usec) -{ -} diff --git a/cppe/src/IceE/TraceLevels.cpp b/cppe/src/IceE/TraceLevels.cpp deleted file mode 100644 index e84ac35e3ca..00000000000 --- a/cppe/src/IceE/TraceLevels.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/TraceLevels.h> -#include <IceE/Properties.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(TraceLevels* p) { return p; } - -IceInternal::TraceLevels::TraceLevels(const PropertiesPtr& properties) : - network(0), - networkCat("Network"), - protocol(0), - protocolCat("Protocol"), - retry(0), - retryCat("Retry"), - location(0), - locationCat("Locator") -{ - const string keyBase = "Ice.Trace."; - const_cast<int&>(network) = properties->getPropertyAsInt(keyBase + networkCat); - const_cast<int&>(protocol) = properties->getPropertyAsInt(keyBase + protocolCat); - const_cast<int&>(retry) = properties->getPropertyAsInt(keyBase + retryCat); - const_cast<int&>(location) = properties->getPropertyAsInt(keyBase + locationCat); -} diff --git a/cppe/src/IceE/TraceLevels.h b/cppe/src/IceE/TraceLevels.h deleted file mode 100644 index 29f3cb3af4e..00000000000 --- a/cppe/src/IceE/TraceLevels.h +++ /dev/null @@ -1,41 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_TRACE_LEVELS_H -#define ICEE_TRACE_LEVELS_H - -#include <IceE/Shared.h> -#include <IceE/TraceLevelsF.h> -#include <IceE/PropertiesF.h> - -namespace IceInternal -{ - -class TraceLevels : public ::IceUtil::Shared -{ -public: - - TraceLevels(const ::Ice::PropertiesPtr&); - - const int network; - const char* networkCat; - - const int protocol; - const char* protocolCat; - - const int retry; - const char* retryCat; - - const int location; - const char* locationCat; -}; - -} - -#endif diff --git a/cppe/src/IceE/TraceUtil.cpp b/cppe/src/IceE/TraceUtil.cpp deleted file mode 100644 index faf4a068c9d..00000000000 --- a/cppe/src/IceE/TraceUtil.cpp +++ /dev/null @@ -1,385 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/TraceUtil.h> -#include <IceE/StringUtil.h> -#include <IceE/ReplyStatus.h> -#include <IceE/TraceLevels.h> -#include <IceE/Logger.h> -#include <IceE/BasicStream.h> -#include <IceE/Protocol.h> -#include <IceE/SafeStdio.h> -#include <IceE/OperationMode.h> -#include <IceE/Identity.h> -#include <IceE/Instance.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -static void -printIdentityFacetOperation(string& s, BasicStream& stream) -{ - Identity identity; - identity.__read(&stream); - s += "\nidentity = "; - s += stream.instance()->identityToString(identity); - - vector<string> facet; - stream.read(facet); - s += "\nfacet = "; - if(!facet.empty()) - { - s += IceUtil::escapeString(facet[0], ""); - } - - string operation; - stream.read(operation); - s += "\noperation = "; - s += operation; -} - -static void -printRequestHeader(string& s, BasicStream& stream) -{ - printIdentityFacetOperation(s, stream); - - Byte mode; - stream.read(mode); - s += Ice::printfToString("\nmode = %d ", static_cast<int>(mode)); - switch(mode) - { - case Normal: - { - s += "(normal)"; - break; - } - - case Nonmutating: - { - s += "(nonmutating)"; - break; - } - - case Idempotent: - { - s += "(idempotent)"; - break; - } - - default: - { - s += "(unknown)"; - break; - } - } - - Int sz; - stream.readSize(sz); - s += "\ncontext = "; - while(sz--) - { - pair<string, string> pair; - stream.read(pair.first); - stream.read(pair.second); - s += pair.first; - s += "/"; - s += pair.second; - if(sz) - { - s += ", "; - } - } -} - -static void -printHeader(string& s, BasicStream& stream) -{ - Byte magicNumber; - stream.read(magicNumber); // Don't bother printing the magic number - stream.read(magicNumber); - stream.read(magicNumber); - stream.read(magicNumber); - - Byte pMajor; - Byte pMinor; - stream.read(pMajor); - stream.read(pMinor); - //Ice::printfToString("\nprotocol version = %d.%d", static_cast<unsigned>(pMajor), - //static_cast<unsigned>(pMinor); - - Byte eMajor; - Byte eMinor; - stream.read(eMajor); - stream.read(eMinor); - //Ice::printfToString("\nencoding version = %d.%d", static_cast<unsigned>(eMajor), - //static_cast<unsigned>(eMinor); - - Byte type; - stream.read(type); - s += Ice::printfToString("\nmessage type = %d ", static_cast<int>(type)); - - switch(type) - { - case requestMsg: - { - s += "(request)"; - break; - } - - case requestBatchMsg: - { - s += "(batch request)"; - break; - } - - case replyMsg: - { - s += "(reply)"; - break; - } - - case closeConnectionMsg: - { - s += "(close connection)"; - break; - } - - case validateConnectionMsg: - { - s += "(validate connection)"; - break; - } - - default: - { - s += "(unknown)"; - break; - } - } - - Byte compress; - stream.read(compress); - s += Ice::printfToString("\ncompression status = %d ", static_cast<int>(compress)); - - switch(compress) - { - case 0: - { - s += "(not compressed; do not compress response, if any)"; - break; - } - - case 1: - { - s += "(not compressed; compress response, if any)"; - break; - } - - case 2: - { - s += "(compressed; compress response, if any)"; - break; - } - - default: - { - s += "(unknown)"; - break; - } - } - - Int size; - stream.read(size); - s += Ice::printfToString("\nmessage size = %d", size); -} - -void -IceInternal::traceHeader(const char* heading, const BasicStream& str, const LoggerPtr& logger, - const TraceLevelsPtr& tl) -{ - BasicStream& stream = const_cast<BasicStream&>(str); - BasicStream::Container::iterator p = stream.i; - stream.i = stream.b.begin(); - - string s(heading); - printHeader(s, stream); - - logger->trace(tl->protocolCat, s); - stream.i = p; -} - -void -IceInternal::traceRequest(const char* heading, const BasicStream& str, const LoggerPtr& logger, - const TraceLevelsPtr& tl) -{ - BasicStream& stream = const_cast<BasicStream&>(str); - BasicStream::Container::iterator p = stream.i; - stream.i = stream.b.begin(); - - string s(heading); - printHeader(s, stream); - - Int requestId; - stream.read(requestId); - s += Ice::printfToString("\nrequest id = %d", requestId); - if(requestId == 0) - { - s += " (oneway)"; - } - - printRequestHeader(s, stream); - - logger->trace(tl->protocolCat, s); - stream.i = p; -} - -#ifdef ICEE_HAS_BATCH -void -IceInternal::traceBatchRequest(const char* heading, const BasicStream& str, const LoggerPtr& logger, - const TraceLevelsPtr& tl) -{ - BasicStream& stream = const_cast<BasicStream&>(str); - BasicStream::Container::iterator p = stream.i; - stream.i = stream.b.begin(); - - string s(heading); - printHeader(s, stream); - - int batchRequestNum; - stream.read(batchRequestNum); - s += Ice::printfToString("\nnumber of requests = %d", batchRequestNum); - - for(int i = 0; i < batchRequestNum; ++i) - { - s += Ice::printfToString("\nrequest #%d:", i); - printRequestHeader(s, stream); - stream.skipEncaps(); - } - - logger->trace(tl->protocolCat, s); - stream.i = p; -} -#endif - -void -IceInternal::traceReply(const char* heading, const BasicStream& str, const LoggerPtr& logger, - const TraceLevelsPtr& tl) -{ - BasicStream& stream = const_cast<BasicStream&>(str); - BasicStream::Container::iterator p = stream.i; - stream.i = stream.b.begin(); - - string s(heading); - printHeader(s, stream); - - Int requestId; - stream.read(requestId); - s += Ice::printfToString("\nrequest id = %d", requestId); - - Byte replyStatus; - stream.read(replyStatus); - s += Ice::printfToString("\nreply status = %d ", static_cast<int>(replyStatus)); - switch(replyStatus) - { - case replyOK: - { - s += "(ok)"; - break; - } - - case replyUserException: - { - s += "(user exception)"; - break; - } - - case replyObjectNotExist: - case replyFacetNotExist: - case replyOperationNotExist: - { - switch(replyStatus) - { - case replyObjectNotExist: - { - s += "(object not exist)"; - break; - } - - case replyFacetNotExist: - { - s += "(facet not exist)"; - break; - } - - case replyOperationNotExist: - { - s += "(operation not exist)"; - break; - } - - default: - { - assert(false); - break; - } - } - - printIdentityFacetOperation(s, stream); - break; - } - - case replyUnknownException: - case replyUnknownLocalException: - case replyUnknownUserException: - { - switch(replyStatus) - { - case replyUnknownException: - { - s += "(unknown exception)"; - break; - } - - case replyUnknownLocalException: - { - s += "(unknown local exception)"; - break; - } - - case replyUnknownUserException: - { - s += "(unknown user exception)"; - break; - } - - default: - { - assert(false); - break; - } - } - - string unknown; - stream.read(unknown); - s += "\nunknown = "; - s += unknown; - break; - } - - default: - { - s += "(unknown)"; - break; - } - } - - logger->trace(tl->protocolCat, s); - stream.i = p; -} diff --git a/cppe/src/IceE/TraceUtil.h b/cppe/src/IceE/TraceUtil.h deleted file mode 100644 index e1798cdb65c..00000000000 --- a/cppe/src/IceE/TraceUtil.h +++ /dev/null @@ -1,30 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_TRACE_UTIL_H -#define ICEE_TRACE_UTIL_H - -#include <IceE/TraceLevelsF.h> -#include <IceE/LoggerF.h> - -namespace IceInternal -{ - -class BasicStream; - -void traceHeader(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); -void traceRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); -#ifdef ICEE_HAS_BATCH -void traceBatchRequest(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); -#endif -void traceReply(const char*, const BasicStream&, const ::Ice::LoggerPtr&, const TraceLevelsPtr&); - -} - -#endif diff --git a/cppe/src/IceE/Transceiver.h b/cppe/src/IceE/Transceiver.h deleted file mode 100644 index 404e125ec17..00000000000 --- a/cppe/src/IceE/Transceiver.h +++ /dev/null @@ -1,96 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_TRANSCEIVER_H -#define ICEE_TRANSCEIVER_H - -#include <IceE/TransceiverF.h> -#include <IceE/InstanceF.h> -#include <IceE/TraceLevelsF.h> -#include <IceE/LoggerF.h> -#include <IceE/Shared.h> - -#ifdef _WIN32 -# include <winsock2.h> -typedef int ssize_t; -#else -# define SOCKET int -#endif - -namespace IceInternal -{ - -class Connector; -class Acceptor; -class Buffer; - -class Transceiver : public ::IceUtil::Shared -{ -public: - - void setTimeouts(int, int); - - SOCKET fd(); - void close(); - void shutdownWrite(); - void shutdownReadWrite(); - void writeWithTimeout(Buffer&, int); - void readWithTimeout(Buffer&, int); - - void write(Buffer& buf) - { - writeWithTimeout(buf, _writeTimeout); - } - - void read(Buffer& buf) - { - readWithTimeout(buf, _readTimeout); - } - - std::string type() const; - std::string toString() const; - -private: - - Transceiver(const InstancePtr&, SOCKET); - virtual ~Transceiver(); - friend class Connector; - friend class Acceptor; - -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - void doSelect(bool, int); -#endif - - const TraceLevelsPtr _traceLevels; - const Ice::LoggerPtr _logger; - - SOCKET _fd; - int _readTimeout; - int _writeTimeout; - -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -#ifdef _WIN32 - WSAEVENT _event; - WSAEVENT _readEvent; - WSAEVENT _writeEvent; -#else - fd_set _wFdSet; - fd_set _rFdSet; -#endif -#endif - - const std::string _desc; -#ifdef _WIN32 - int _maxPacketSize; -#endif -}; - -} - -#endif diff --git a/cppe/src/IceE/UUID.cpp b/cppe/src/IceE/UUID.cpp deleted file mode 100644 index 1227edc5afb..00000000000 --- a/cppe/src/IceE/UUID.cpp +++ /dev/null @@ -1,307 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Config.h> -#include <IceE/UUID.h> - -// On Windows, we use Windows's RPC UUID generator. -// -// Under WinCE we use the Cryptography functions to generate random -// numbers which should be suitable for a "version 4" UUID. -// -// On other platforms, we use a high quality random number generator -// (/dev/random) to generate "version 4" UUIDs, as described in -// http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-00.txt -// - - -#ifdef _WIN32_WCE -# include <wincrypt.h> -# include <IceE/StaticMutex.h> -#elif defined(_WIN32) -# include <rpc.h> -#else -# include <IceE/StaticMutex.h> -# include <sys/types.h> -# include <sys/stat.h> -# include <fcntl.h> -# include <unistd.h> -#endif - -using namespace std; - -// Helper char to hex functions -// -inline void halfByteToHex(unsigned char hb, char*& hexBuffer) -{ - if(hb < 10) - { - *hexBuffer++ = '0' + hb; - } - else - { - *hexBuffer++ = 'A' + (hb - 10); - } -} - -inline void bytesToHex(unsigned char* bytes, size_t len, char*& hexBuffer) -{ - for(size_t i = 0; i < len; i++) - { - halfByteToHex((bytes[i] & 0xF0) >> 4, hexBuffer); - halfByteToHex((bytes[i] & 0x0F), hexBuffer); - } -} - - -IceUtil::UUIDGenerationException::UUIDGenerationException(const char* file, int line) : - Exception(file, line) -{ -} - -const char* IceUtil::UUIDGenerationException::_name = "IceUtil::UUIDGenerationException"; - -#ifdef _WIN32_WCE - -static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER; -static HCRYPTPROV cryptProv = 0; - -namespace -{ - -// -// Close the crypt provider on exit. -// -class UUIDCleanup -{ -public: - - ~UUIDCleanup() - { - IceUtil::StaticMutex::Lock lock(staticMutex); - if(cryptProv != 0) - { - CryptReleaseContext(cryptProv, 0); - cryptProv = 0; - } - } -}; - -static UUIDCleanup uuidCleanup; - -} - -#elif !defined(_WIN32) -// -// Unfortunately on Linux (at least up to 2.6.9), concurrent access to /dev/urandom -// can return the same value. Search for "Concurrent access to /dev/urandom" in the -// linux-kernel mailing list archive for additional details. -// Since /dev/urandom on other platforms is usually a port from Linux, this problem -// could be widespread. Therefore, instead of using 122 random bits that could be -// duplicated, we replace the last 15 bits of all "random" UUIDs by the last 15 bits -// of the process id, and in each process, we serialize access to /dev/urandom using -// a static mutex. -// - -static IceUtil::StaticMutex staticMutex = ICE_STATIC_MUTEX_INITIALIZER; -static int fd = -1; -static char myPid[2]; - -namespace -{ - -// -// Close fd at exit -// -class UUIDCleanup -{ -public: - - ~UUIDCleanup() - { - IceUtil::StaticMutex::Lock lock(staticMutex); - if(fd != -1) - { - close(fd); - fd = -1; - } - } -}; -static UUIDCleanup uuidCleanup; -} - - -#endif - -string -IceUtil::UUIDGenerationException::ice_name() const -{ - return _name; -} - -IceUtil::Exception* -IceUtil::UUIDGenerationException::ice_clone() const -{ - return new UUIDGenerationException(*this); -} - -void -IceUtil::UUIDGenerationException::ice_throw() const -{ - throw *this; -} - - -string -IceUtil::generateUUID() -{ -#if defined(_WIN32 ) && !defined(_WIN32_WCE) - - UUID uuid; - UuidCreate(&uuid); - - unsigned char* str; - - UuidToString(&uuid, &str); - - string result = reinterpret_cast<char*>(str); - - RpcStringFree(&str); - return result; - -#else - - struct UUID - { - unsigned char timeLow[4]; - unsigned char timeMid[2]; - unsigned char timeHighAndVersion[2]; - unsigned char clockSeqHiAndReserved; - unsigned char clockSeqLow; - unsigned char node[6]; - }; - UUID uuid; - - assert(sizeof(UUID) == 16); - - char* buffer = reinterpret_cast<char*>(&uuid); - int reads = 0; - size_t index = 0; - -#ifdef _WIN32_WCE - - HCRYPTPROV localProv; - - { - IceUtil::StaticMutex::Lock lock(staticMutex); - if(cryptProv == 0) - { - if(!CryptAcquireContext(&cryptProv, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) - { - throw UUIDGenerationException(__FILE__, __LINE__); - } - } - localProv = cryptProv; - } - - memset(buffer, 0, 16); - if(!CryptGenRandom(localProv, 16, (unsigned char*)buffer)) - { - throw UUIDGenerationException(__FILE__, __LINE__); - } - -#else - { - // - // Serialize access to /dev/urandom; see comment above. - // - IceUtil::StaticMutex::Lock lock(staticMutex); - if(fd == -1) - { - fd = open("/dev/urandom", O_RDONLY); - if (fd == -1) - { - assert(0); - throw UUIDGenerationException(__FILE__, __LINE__); - } - - // - // Initialize myPid as well - // - pid_t pid = getpid(); - myPid[0] = (pid >> 8) & 0x7F; - myPid[1] = pid & 0xFF; - } - - - // - // Limit the number of attempts to 20 reads to avoid - // a potential "for ever" loop - // - while(reads <= 20 && index != sizeof(UUID)) - { - ssize_t bytesRead = read(fd, buffer + index, sizeof(UUID) - index); - - if(bytesRead == -1 && errno != EINTR) - { - int err = errno; - fprintf(stderr, "Reading /dev/urandom returned %s\n", strerror(err)); - assert(0); - throw UUIDGenerationException(__FILE__, __LINE__); - } - else - { - index += bytesRead; - reads++; - } - } - } - - if (index != sizeof(UUID)) - { - assert(0); - throw UUIDGenerationException(__FILE__, __LINE__); - } - - // - // Replace the end of the node by myPid (15 bits) - // - uuid.node[4] = (uuid.node[4] & 0x80) | myPid[0]; - uuid.node[5] = myPid[1]; -#endif - - // - // Adjust the bits that say "version 4" UUID - // - uuid.timeHighAndVersion[0] &= 0x0F; - uuid.timeHighAndVersion[0] |= (4 << 4); - uuid.clockSeqHiAndReserved &= 0x3F; - uuid.clockSeqHiAndReserved |= 0x80; - - // - // Convert to a UUID string - // - char uuidString[16 * 2 + 4 + 1]; // 16 bytes, 4 '-' and a final '\0' - char* uuidIndex = uuidString; - bytesToHex(uuid.timeLow, sizeof(uuid.timeLow), uuidIndex); - *uuidIndex++ = '-'; - bytesToHex(uuid.timeMid, sizeof(uuid.timeMid), uuidIndex); - *uuidIndex++ = '-'; - bytesToHex(uuid.timeHighAndVersion, sizeof(uuid.timeHighAndVersion), uuidIndex); - *uuidIndex++ = '-'; - bytesToHex(&uuid.clockSeqHiAndReserved, sizeof(uuid.clockSeqHiAndReserved), uuidIndex); - bytesToHex(&uuid.clockSeqLow, sizeof(uuid.clockSeqLow), uuidIndex); - *uuidIndex++ = '-'; - bytesToHex(uuid.node, sizeof(uuid.node), uuidIndex); - *uuidIndex = '\0'; - - return uuidString; - -#endif -} diff --git a/cppe/src/IceE/Unicode.cpp b/cppe/src/IceE/Unicode.cpp deleted file mode 100644 index 356986c7100..00000000000 --- a/cppe/src/IceE/Unicode.cpp +++ /dev/null @@ -1,276 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Config.h> - -#if defined(ICEE_HAS_WSTRING) - -#include <IceE/Unicode.h> -#include <IceE/ConvertUTF.h> - -using namespace std; -using namespace IceUtil; - -namespace -{ -// -// Helper class, base never defined -// Usage: WstringHelper<sizeof(wchar_t)>::toUTF8 and fromUTF8. -// -template<size_t wcharSize> -struct WstringHelper -{ - static ConversionResult toUTF8( - const wchar_t*& sourceStart, const wchar_t* sourceEnd, - Byte*& targetStart, Byte* targetEnd, ConversionFlags flags); - - static ConversionResult fromUTF8( - const Byte*& sourceStart, const Byte* sourceEnd, - wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags); -}; - -template<> -struct WstringHelper<2> -{ - static ConversionResult toUTF8( - const wchar_t*& sourceStart, const wchar_t* sourceEnd, - Byte*& targetStart, Byte* targetEnd, ConversionFlags flags) - { - return ConvertUTF16toUTF8( - reinterpret_cast<const UTF16**>(&sourceStart), - reinterpret_cast<const UTF16*>(sourceEnd), - &targetStart, targetEnd, flags); - } - - static ConversionResult fromUTF8( - const Byte*& sourceStart, const Byte* sourceEnd, - wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags) - { - return ConvertUTF8toUTF16( - &sourceStart, sourceEnd, - reinterpret_cast<UTF16**>(&targetStart), - reinterpret_cast<UTF16*>(targetEnd), flags); - } -}; - -template<> -struct WstringHelper<4> -{ - static ConversionResult toUTF8( - const wchar_t*& sourceStart, const wchar_t* sourceEnd, - Byte*& targetStart, Byte* targetEnd, ConversionFlags flags) - { - return ConvertUTF32toUTF8( - reinterpret_cast<const UTF32**>(&sourceStart), - reinterpret_cast<const UTF32*>(sourceEnd), - &targetStart, targetEnd, flags); - } - - static ConversionResult fromUTF8( - const Byte*& sourceStart, const Byte* sourceEnd, - wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags) - { - return ConvertUTF8toUTF32( - &sourceStart, sourceEnd, - reinterpret_cast<UTF32**>(&targetStart), - reinterpret_cast<UTF32*>(targetEnd), flags); - } -}; -} - -// -// convertXXX functions -// - -ConversionResult -IceUtil::convertUTFWstringToUTF8( - const wchar_t*& sourceStart, const wchar_t* sourceEnd, - Byte*& targetStart, Byte* targetEnd, ConversionFlags flags) -{ - return WstringHelper<sizeof(wchar_t)>::toUTF8( - sourceStart, sourceEnd, targetStart, targetEnd, flags); -} - -ConversionResult -IceUtil::convertUTF8ToUTFWstring( - const Byte*& sourceStart, const Byte* sourceEnd, - wchar_t*& targetStart, wchar_t* targetEnd, ConversionFlags flags) -{ - return WstringHelper<sizeof(wchar_t)>::fromUTF8( - sourceStart, sourceEnd, targetStart, targetEnd, flags); -} - -ConversionResult -IceUtil::convertUTF8ToUTFWstring(const Byte*& sourceStart, const Byte* sourceEnd, - std::wstring& target, ConversionFlags flags) -{ - // - // Could be reimplemented without this temporary wchar_t buffer - // - size_t size = static_cast<size_t>(sourceEnd - sourceStart); - wchar_t* outBuf = new wchar_t[size]; - wchar_t* targetStart = outBuf; - wchar_t* targetEnd = targetStart + size; - - ConversionResult result = - convertUTF8ToUTFWstring(sourceStart, sourceEnd, targetStart, - targetEnd, flags); - - if(result == conversionOK) - { - std::wstring s(outBuf, static_cast<size_t>(targetStart - outBuf)); - s.swap(target); - } - delete[] outBuf; - return result; -} - - -// -// wstringToString and stringToWstring -// - -const char* IceUtil::UTFConversionException::_name = "IceUtil::UTFConversionException"; - -IceUtil::UTFConversionException::UTFConversionException(const char* file, int line, - ConversionResult cr): - Exception(file, line), - _conversionResult(cr) -{} - -string -IceUtil::UTFConversionException::ice_name() const -{ - return _name; -} - -string -IceUtil::UTFConversionException::toString() const -{ - string str = Exception::toString(); - switch(_conversionResult) - { - case sourceExhausted: - str += ": source exhausted"; - break; - case targetExhausted: - str += ": target exhausted"; - break; - case sourceIllegal: - str += ": illegal source"; - break; - default: - assert(0); - break; - }; - return str; -} - -IceUtil::Exception* -IceUtil::UTFConversionException::ice_clone() const -{ - return new UTFConversionException(*this); -} - -void -IceUtil::UTFConversionException::ice_throw() const -{ - throw *this; -} - -IceUtil::ConversionResult -IceUtil::UTFConversionException::conversionResult() const -{ - return _conversionResult; -} - - -string -IceUtil::wstringToString(const wstring& wstr) -{ - string target; - - size_t size = wstr.size() * 3 * (sizeof(wchar_t) / 2); - - Byte* outBuf = new Byte[size]; - Byte* targetStart = outBuf; - Byte* targetEnd = outBuf + size; - - const wchar_t* sourceStart = wstr.data(); - - ConversionResult cr = - convertUTFWstringToUTF8( - sourceStart, sourceStart + wstr.size(), - targetStart, targetEnd, lenientConversion); - - if(cr != conversionOK) - { - delete[] outBuf; - throw UTFConversionException(__FILE__, __LINE__, cr); - } - - string s(reinterpret_cast<char*>(outBuf), - static_cast<size_t>(targetStart - outBuf)); - s.swap(target); - delete[] outBuf; - return target; -} - -wstring -IceUtil::stringToWstring(const string& str) -{ - wstring result; - const Byte* sourceStart = reinterpret_cast<const Byte*>(str.data()); - - ConversionResult cr - = convertUTF8ToUTFWstring(sourceStart, sourceStart + str.size(), - result, lenientConversion); - - if(cr != conversionOK) - { - throw UTFConversionException(__FILE__, __LINE__, cr); - } - return result; -} - - -#if defined(_MSC_VER) && (_MSC_VER >= 1300) -// -// See comments in IceUtil/Unicode.h -// - -# if _MSC_VER < 1400 -string -IceUtil::wstringToString(const basic_string<__wchar_t>& str) -{ - return wstringToString(*reinterpret_cast<const wstring*>(&str)); -} - -basic_string<__wchar_t> -IceUtil::stringToNativeWstring(const string& str) -{ - return reinterpret_cast<basic_string<__wchar_t>& >(stringToWstring(str)); -} -# else -string -IceUtil::wstringToString(const basic_string<unsigned short>& str) -{ - return wstringToString(*reinterpret_cast<const wstring*>(&str)); -} - -basic_string<unsigned short> -IceUtil::stringToTypedefWstring(const string& str) -{ - return reinterpret_cast<basic_string<unsigned short>& >(stringToWstring(str)); -} - -# endif -#endif - -#endif diff --git a/cppe/src/IceE/UnknownEndpoint.cpp b/cppe/src/IceE/UnknownEndpoint.cpp deleted file mode 100644 index db1e6168d6a..00000000000 --- a/cppe/src/IceE/UnknownEndpoint.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/UnknownEndpoint.h> -#include <IceE/BasicStream.h> -#include <IceE/Exception.h> -#include <IceE/Instance.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceInternal::UnknownEndpoint::UnknownEndpoint(Short type, BasicStream* s) : - _instance(s->instance()), - _type(type) -{ - s->startReadEncaps(); - Int sz = s->getReadEncapsSize(); - s->readBlob(const_cast<vector<Byte>&>(_rawBytes), sz); - s->endReadEncaps(); -} - -void -IceInternal::UnknownEndpoint::streamWrite(BasicStream* s) const -{ - s->write(_type); - s->startWriteEncaps(); - s->writeBlob(_rawBytes); - s->endWriteEncaps(); -} - -string -IceInternal::UnknownEndpoint::toString() const -{ - return string(); -} - -Short -IceInternal::UnknownEndpoint::type() const -{ - return _type; -} - -Int -IceInternal::UnknownEndpoint::timeout() const -{ - return -1; -} - -EndpointPtr -IceInternal::UnknownEndpoint::timeout(Int) const -{ - return const_cast<UnknownEndpoint*>(this); -} - -bool -IceInternal::UnknownEndpoint::secure() const -{ - return false; -} - -bool -IceInternal::UnknownEndpoint::datagram() const -{ - return false; -} - -bool -IceInternal::UnknownEndpoint::unknown() const -{ - return true; -} - -ConnectorPtr -IceInternal::UnknownEndpoint::connector() const -{ - return 0; -} - -#ifndef ICEE_PURE_CLIENT -AcceptorPtr -IceInternal::UnknownEndpoint::acceptor(EndpointPtr& endp) const -{ - endp = const_cast<UnknownEndpoint*>(this); - return 0; -} - -bool -IceInternal::UnknownEndpoint::publish() const -{ - return false; -} - -#endif - -vector<EndpointPtr> -IceInternal::UnknownEndpoint::expand(bool) const -{ - assert(false); - vector<EndpointPtr> ret; - return ret; - -} - -bool -IceInternal::UnknownEndpoint::operator==(const Endpoint& r) const -{ - const UnknownEndpoint* p = dynamic_cast<const UnknownEndpoint*>(&r); - if(!p) - { - return false; - } - - if(this == p) - { - return true; - } - - if(_type != p->_type) - { - return false; - } - - if(_rawBytes != p->_rawBytes) - { - return false; - } - - return true; -} - -bool -IceInternal::UnknownEndpoint::operator!=(const Endpoint& r) const -{ - return !operator==(r); -} - -bool -IceInternal::UnknownEndpoint::operator<(const Endpoint& r) const -{ - const UnknownEndpoint* p = dynamic_cast<const UnknownEndpoint*>(&r); - if(!p) - { - return type() < r.type(); - } - - if(this == p) - { - return false; - } - - if(_type < p->_type) - { - return true; - } - else if(p->_type < _type) - { - return false; - } - - if(_rawBytes < p->_rawBytes) - { - return true; - } - else if(p->_rawBytes < _rawBytes) - { - return false; - } - - return false; -} diff --git a/cppe/src/IceE/UnknownEndpoint.h b/cppe/src/IceE/UnknownEndpoint.h deleted file mode 100644 index c2e129308c4..00000000000 --- a/cppe/src/IceE/UnknownEndpoint.h +++ /dev/null @@ -1,55 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_UNKNOWN_ENDPOINT_H -#define ICEE_UNKNOWN_ENDPOINT_H - -#include <IceE/Endpoint.h> - -namespace IceInternal -{ - -class UnknownEndpoint : public Endpoint -{ -public: - - UnknownEndpoint(Ice::Short, BasicStream*); - - virtual void streamWrite(BasicStream*) const; - virtual std::string toString() const; - virtual Ice::Short type() const; - virtual Ice::Int timeout() const; - virtual EndpointPtr timeout(Ice::Int) const; - virtual bool secure() const; - virtual bool datagram() const; - virtual bool unknown() const; - virtual ConnectorPtr connector() const; -#ifndef ICEE_PURE_CLIENT - virtual AcceptorPtr acceptor(EndpointPtr&) const; - virtual bool publish() const; -#endif - virtual std::vector<EndpointPtr> expand(bool) const; - - virtual bool operator==(const Endpoint&) const; - virtual bool operator!=(const Endpoint&) const; - virtual bool operator<(const Endpoint&) const; - -private: - - // - // All members are const, because endpoints are immutable. - // - const InstancePtr _instance; - Ice::Short _type; - const std::vector<Ice::Byte> _rawBytes; -}; - -} - -#endif diff --git a/cppe/src/IceEC/.depend b/cppe/src/IceEC/.depend deleted file mode 100644 index b8e61ae2520..00000000000 --- a/cppe/src/IceEC/.depend +++ /dev/null @@ -1,56 +0,0 @@ -BasicStream$(OBJEXT): ../../src/IceE/BasicStream.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Properties.h ../../include/IceE/PropertiesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/ProxyFactory.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/LocalException.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/LoggerUtil.h -Buffer$(OBJEXT): ../../src/IceE/Buffer.cpp ../../include/IceE/Buffer.h ../../include/IceE/Config.h ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h -BuiltinSequences$(OBJEXT): ../../src/IceE/BuiltinSequences.cpp ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -Communicator$(OBJEXT): ../../src/IceE/Communicator.cpp ../../include/IceE/Communicator.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/PropertiesF.h ../../include/IceE/InstanceF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Router.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../IceE/Instance.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Properties.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorF.h ../IceE/ProxyFactory.h ../../include/IceE/LoggerUtil.h ../../include/IceE/LocalException.h -Cond$(OBJEXT): ../../src/IceE/Cond.cpp ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Config.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -Connection$(OBJEXT): ../../src/IceE/Connection.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Connection.h ../../include/IceE/ConnectionF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ReferenceF.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/LoggerUtil.h ../../include/IceE/Properties.h ../IceE/TraceUtil.h ../IceE/DefaultsAndOverrides.h ../IceE/Transceiver.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/LocalException.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorF.h ../IceE/ProxyFactory.h ../IceE/TraceLevels.h -ConvertUTF$(OBJEXT): ../../src/IceE/ConvertUTF.cpp ../../include/IceE/Config.h ../IceE/ConvertUTF.h ../../include/IceE/Unicode.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -DefaultsAndOverrides$(OBJEXT): ../../src/IceE/DefaultsAndOverrides.cpp ../IceE/DefaultsAndOverrides.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/PropertiesF.h ../../include/IceE/Properties.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Network.h -Endpoint$(OBJEXT): ../../src/IceE/Endpoint.cpp ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h -ExceptionBase$(OBJEXT): ../../src/IceE/ExceptionBase.cpp ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/SafeStdio.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h -FactoryTable$(OBJEXT): ../../src/IceE/FactoryTable.cpp ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Mutex.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/Shared.h -FactoryTableDef$(OBJEXT): ../../src/IceE/FactoryTableDef.cpp ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/StaticMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Mutex.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/Shared.h -Identity$(OBJEXT): ../../src/IceE/Identity.cpp ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Shared.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -Initialize$(OBJEXT): ../../src/IceE/Initialize.cpp ../../include/IceE/Initialize.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/PropertiesF.h ../../include/IceE/LoggerF.h ../../include/IceE/InstanceF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Communicator.h ../../include/IceE/RecMutex.h ../../include/IceE/Properties.h ../../include/IceE/LocalException.h -Instance$(OBJEXT): ../../src/IceE/Instance.cpp ../../include/IceE/DisableWarnings.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../IceE/DefaultsAndOverrides.h ../IceE/RouterInfo.h ../../include/IceE/RouterF.h ../../include/IceE/EndpointF.h ../../include/IceE/Router.h ../IceE/LocatorInfo.h ../../include/IceE/LocatorF.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../IceE/ReferenceFactory.h ../IceE/Reference.h ../IceE/ProxyFactory.h ../IceE/OutgoingConnectionFactory.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/LocalException.h ../../include/IceE/Properties.h ../IceE/LoggerI.h ../../include/IceE/Logger.h ../IceE/EndpointFactory.h ../../include/IceE/StringUtil.h -LocalException$(OBJEXT): ../../src/IceE/LocalException.cpp ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/SafeStdio.h ../../include/IceE/StringUtil.h ../IceE/Network.h -Locator$(OBJEXT): ../../src/IceE/Locator.cpp ../../include/IceE/Locator.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -LocatorInfo$(OBJEXT): ../../src/IceE/LocatorInfo.cpp ../../include/IceE/Config.h ../IceE/LocatorInfo.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Shared.h ../../include/IceE/LocatorF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/EndpointF.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/Reference.h ../../include/IceE/RouterF.h ../../include/IceE/Functional.h -Logger$(OBJEXT): ../../src/IceE/Logger.cpp ../../include/IceE/Logger.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h -LoggerI$(OBJEXT): ../../src/IceE/LoggerI.cpp ../IceE/LoggerI.h ../../include/IceE/Logger.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/StaticMutex.h -LoggerUtil$(OBJEXT): ../../src/IceE/LoggerUtil.cpp ../../include/IceE/LoggerUtil.h ../../include/IceE/LoggerF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Logger.h -Network$(OBJEXT): ../../src/IceE/Network.cpp ../../include/IceE/StaticMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../IceE/Network.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/SafeStdio.h -OperationMode$(OBJEXT): ../../src/IceE/OperationMode.cpp ../../include/IceE/OperationMode.h ../../include/IceE/Config.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/Shared.h -Outgoing$(OBJEXT): ../../src/IceE/Outgoing.cpp ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/ReplyStatus.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../IceE/Reference.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h -OutgoingConnectionFactory$(OBJEXT): ../../src/IceE/OutgoingConnectionFactory.cpp ../IceE/OutgoingConnectionFactory.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/InstanceF.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Connection.h ../../include/IceE/TransceiverF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Thread.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ReferenceF.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../IceE/DefaultsAndOverrides.h ../IceE/Connector.h ../IceE/ConnectorF.h ../IceE/Endpoint.h ../IceE/RouterInfo.h ../../include/IceE/RouterF.h ../../include/IceE/LocalException.h ../../include/IceE/Functional.h ../IceE/Reference.h ../../include/IceE/LocatorF.h -Properties$(OBJEXT): ../../src/IceE/Properties.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Properties.h ../../include/IceE/PropertiesF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/StringUtil.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/InstanceF.h ../../include/IceE/LocalException.h -Protocol$(OBJEXT): ../../src/IceE/Protocol.cpp ../../include/IceE/Protocol.h ../../include/IceE/Config.h -Proxy$(OBJEXT): ../../src/IceE/Proxy.cpp ../../include/IceE/Communicator.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/PropertiesF.h ../../include/IceE/InstanceF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/ProxyFactory.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../IceE/Reference.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../IceE/Instance.h ../IceE/DefaultsAndOverridesF.h ../IceE/ReferenceFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/LocalException.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h -ProxyFactory$(OBJEXT): ../../src/IceE/ProxyFactory.cpp ../IceE/ProxyFactory.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/ReferenceF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Thread.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Time.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/Reference.h ../../include/IceE/EndpointF.h ../../include/IceE/RouterF.h ../../include/IceE/LocatorF.h ../IceE/ReferenceFactory.h ../IceE/LocatorInfo.h ../../include/IceE/Properties.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../../include/IceE/LocalException.h ../../include/IceE/SafeStdio.h -RecMutex$(OBJEXT): ../../src/IceE/RecMutex.cpp ../../include/IceE/RecMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -Reference$(OBJEXT): ../../src/IceE/Reference.cpp ../IceE/Reference.h ../../include/IceE/ReferenceF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../IceE/ReferenceFactory.h ../IceE/ReferenceFactoryF.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/Connection.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Functional.h ../IceE/OutgoingConnectionFactory.h ../../include/IceE/ObjectAdapterF.h ../../include/IceE/LoggerUtil.h ../IceE/TraceLevels.h ../../include/IceE/StringUtil.h -ReferenceFactory$(OBJEXT): ../../src/IceE/ReferenceFactory.cpp ../IceE/ReferenceFactory.h ../IceE/ReferenceFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../IceE/Reference.h ../../include/IceE/ReferenceF.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../../include/IceE/LocalException.h ../../include/IceE/BuiltinSequences.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../IceE/EndpointFactory.h ../IceE/RouterInfo.h ../../include/IceE/Router.h ../IceE/LocatorInfo.h ../../include/IceE/Locator.h ../../include/IceE/UserExceptionFactory.h ../../include/IceE/FactoryTable.h ../../include/IceE/FactoryTableDef.h ../../include/IceE/UserExceptionFactoryF.h ../../include/IceE/StaticMutex.h ../../include/IceE/StringUtil.h ../../include/IceE/LoggerUtil.h ../../include/IceE/Properties.h ../../include/IceE/Communicator.h -Router$(OBJEXT): ../../src/IceE/Router.cpp ../../include/IceE/Router.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/Shared.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/InstanceF.h ../../include/IceE/TransceiverF.h ../../include/IceE/EndpointF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/LocalException.h ../../include/IceE/Iterator.h ../../include/IceE/DisableWarnings.h -RouterInfo$(OBJEXT): ../../src/IceE/RouterInfo.cpp ../../include/IceE/Config.h ../IceE/RouterInfo.h ../../include/IceE/RouterInfoF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Shared.h ../../include/IceE/RouterF.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Exception.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/EndpointF.h ../../include/IceE/Router.h ../../include/IceE/BuiltinSequences.h ../IceE/Reference.h ../../include/IceE/InstanceF.h ../../include/IceE/LocatorInfoF.h ../../include/IceE/LocatorF.h ../../include/IceE/RecMutex.h ../../include/IceE/LocalException.h ../../include/IceE/Connection.h ../../include/IceE/OutgoingConnectionFactoryF.h ../../include/IceE/TransceiverF.h ../../include/IceE/LoggerF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Monitor.h ../../include/IceE/Cond.h ../../include/IceE/Time.h ../../include/IceE/Thread.h ../../include/IceE/Functional.h -SafeStdio$(OBJEXT): ../../src/IceE/SafeStdio.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/SafeStdio.h ../../include/IceE/Config.h -Shared$(OBJEXT): ../../src/IceE/Shared.cpp ../../include/IceE/Shared.h ../../include/IceE/Config.h -StaticMutex$(OBJEXT): ../../src/IceE/StaticMutex.cpp ../../include/IceE/StaticMutex.h ../../include/IceE/Config.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h -StringConverter$(OBJEXT): ../../src/IceE/StringConverter.cpp ../../include/IceE/Config.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../../include/IceE/Shared.h ../../include/IceE/Unicode.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h -StringUtil$(OBJEXT): ../../src/IceE/StringUtil.cpp ../../include/IceE/StringUtil.h ../../include/IceE/Config.h ../../include/IceE/ExceptionBase.h -Thread$(OBJEXT): ../../src/IceE/Thread.cpp ../../include/IceE/Thread.h ../../include/IceE/Shared.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Time.h -ThreadException$(OBJEXT): ../../src/IceE/ThreadException.cpp ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Handle.h ../../include/IceE/SafeStdio.h -Time$(OBJEXT): ../../src/IceE/Time.cpp ../../include/IceE/DisableWarnings.h ../../include/IceE/Time.h ../../include/IceE/Config.h -TraceLevels$(OBJEXT): ../../src/IceE/TraceLevels.cpp ../IceE/TraceLevels.h ../../include/IceE/Shared.h ../../include/IceE/Config.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/PropertiesF.h ../../include/IceE/Properties.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h -TraceUtil$(OBJEXT): ../../src/IceE/TraceUtil.cpp ../IceE/TraceUtil.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/LoggerF.h ../../include/IceE/StringUtil.h ../IceE/ReplyStatus.h ../IceE/TraceLevels.h ../../include/IceE/PropertiesF.h ../../include/IceE/Logger.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/SafeStdio.h ../../include/IceE/OperationMode.h ../../include/IceE/Identity.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../IceE/Instance.h ../../include/IceE/InstanceF.h ../../include/IceE/CommunicatorF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Outgoing.h -UnknownEndpoint$(OBJEXT): ../../src/IceE/UnknownEndpoint.cpp ../IceE/UnknownEndpoint.h ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../../include/IceE/TraceLevelsF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Initialize.h ../../include/IceE/LoggerF.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h -Unicode$(OBJEXT): ../../src/IceE/Unicode.cpp ../../include/IceE/Config.h ../../include/IceE/Unicode.h ../../include/IceE/Exception.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Handle.h ../IceE/ConvertUTF.h -Connector$(OBJEXT): ../../src/TcpTransport/Connector.cpp ../IceE/Connector.h ../IceE/ConnectorF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Transceiver.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Network.h -EndpointFactory$(OBJEXT): ../../src/TcpTransport/EndpointFactory.cpp ../IceE/EndpointFactory.h ../IceE/EndpointFactoryF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/EndpointF.h ../../include/IceE/InstanceF.h ../IceE/UnknownEndpoint.h ../IceE/Endpoint.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/LocalException.h ../../include/IceE/Exception.h ../../include/IceE/Identity.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../TcpTransport/TcpEndpoint.h -TcpEndpoint$(OBJEXT): ../../src/TcpTransport/TcpEndpoint.cpp ../TcpTransport/TcpEndpoint.h ../IceE/Endpoint.h ../../include/IceE/EndpointF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../IceE/ConnectorF.h ../../include/IceE/TransceiverF.h ../../include/IceE/InstanceF.h ../IceE/Network.h ../IceE/Connector.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Transceiver.h ../../include/IceE/BasicStream.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../../include/IceE/Exception.h ../../include/IceE/LocalException.h ../../include/IceE/Identity.h ../../include/IceE/ScopedArray.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/Proxy.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/CommunicatorF.h ../../include/IceE/Mutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../IceE/Instance.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Initialize.h ../IceE/DefaultsAndOverrides.h ../../include/IceE/SafeStdio.h -Transceiver$(OBJEXT): ../../src/TcpTransport/Transceiver.cpp ../IceE/Transceiver.h ../../include/IceE/TransceiverF.h ../../include/IceE/Handle.h ../../include/IceE/ExceptionBase.h ../../include/IceE/Config.h ../../include/IceE/Shared.h ../../include/IceE/InstanceF.h ../../include/IceE/TraceLevelsF.h ../../include/IceE/LoggerF.h ../IceE/Instance.h ../../include/IceE/CommunicatorF.h ../../include/IceE/PropertiesF.h ../IceE/DefaultsAndOverridesF.h ../../include/IceE/RouterInfoF.h ../../include/IceE/LocatorInfoF.h ../IceE/ReferenceFactoryF.h ../../include/IceE/ProxyFactoryF.h ../../include/IceE/OutgoingConnectionFactoryF.h ../IceE/EndpointFactoryF.h ../../include/IceE/RecMutex.h ../../include/IceE/Lock.h ../../include/IceE/ThreadException.h ../../include/IceE/Exception.h ../../include/IceE/Initialize.h ../../include/IceE/BuiltinSequences.h ../../include/IceE/ProxyF.h ../../include/IceE/ProxyHandle.h ../../include/IceE/ScopedArray.h ../../include/IceE/Proxy.h ../../include/IceE/ConnectionF.h ../../include/IceE/ReferenceF.h ../../include/IceE/Mutex.h ../../include/IceE/Identity.h ../../include/IceE/UndefSysMacros.h ../../include/IceE/OperationMode.h ../../include/IceE/Outgoing.h ../../include/IceE/BasicStream.h ../../include/IceE/Buffer.h ../../include/IceE/Protocol.h ../../include/IceE/StringConverter.h ../IceE/TraceLevels.h ../../include/IceE/LoggerUtil.h ../IceE/Network.h ../../include/IceE/LocalException.h ../../include/IceE/SafeStdio.h -BuiltinSequences.cpp: ../../slice/IceE/BuiltinSequences.ice -Identity.cpp: ../../slice/IceE/Identity.ice -Locator.cpp: ../../slice/IceE/Locator.ice ../../slice/IceE/Identity.ice -LocatorF.cpp: ../../slice/IceE/LocatorF.ice -Router.cpp: ../../slice/IceE/Router.ice ../../slice/IceE/BuiltinSequences.ice -RouterF.cpp: ../../slice/IceE/RouterF.ice diff --git a/cppe/src/IceEC/.gitignore b/cppe/src/IceEC/.gitignore deleted file mode 100644 index 5ffab7842ed..00000000000 --- a/cppe/src/IceEC/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by makegitignore.py - -// IMPORTANT: Do not edit this file -- any edits made here will be lost! -BuiltinSequences.cpp -Identity.cpp -Locator.cpp -LocatorF.cpp -Router.cpp -RouterF.cpp -BuiltinSequences.h -Identity.h -Locator.h -LocatorF.h -Router.h -RouterF.h diff --git a/cppe/src/IceEC/Makefile b/cppe/src/IceEC/Makefile deleted file mode 100644 index a53da77b7f8..00000000000 --- a/cppe/src/IceEC/Makefile +++ /dev/null @@ -1,142 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -# -# This copy of Ice-E is licensed to you under the terms described in the -# ICEE_LICENSE file included in this distribution. -# -# ********************************************************************** - -top_srcdir = ../.. - -LIBFILENAME = $(call mklibfilename,IceEC,$(VERSION)) -SONAME = $(call mksoname,IceEC,$(SOVERSION)) -LIBNAME = $(call mklibname,IceEC) - -TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) - -TRANSPORT_DIR = $(top_srcdir)/src/TcpTransport - -ICE_DIR = $(top_srcdir)/src/IceE - -TRANSPORT_OBJS = Connector.o \ - EndpointFactory.o \ - TcpEndpoint.o \ - Transceiver.o - -ICE_OBJS = BasicStream.o \ - Buffer.o \ - BuiltinSequences.o \ - Communicator.o \ - Cond.o \ - Connection.o \ - ConvertUTF.o \ - DefaultsAndOverrides.o \ - Endpoint.o \ - ExceptionBase.o \ - FactoryTable.o \ - FactoryTableDef.o \ - Identity.o \ - Initialize.o \ - Instance.o \ - LocalException.o \ - Locator.o \ - LocatorInfo.o \ - Logger.o \ - LoggerI.o \ - LoggerUtil.o \ - Network.o \ - OperationMode.o \ - Outgoing.o \ - OutgoingConnectionFactory.o \ - Properties.o \ - Protocol.o \ - Proxy.o \ - ProxyFactory.o \ - RecMutex.o \ - Reference.o \ - ReferenceFactory.o \ - Router.o \ - RouterInfo.o \ - SafeStdio.o \ - Shared.o \ - StaticMutex.o \ - StringConverter.o \ - StringUtil.o \ - Thread.o \ - ThreadException.o \ - Time.o \ - TraceLevels.o \ - TraceUtil.o \ - UnknownEndpoint.o \ - Unicode.o - -OBJS = $(LOCAL_OBJS) $(ICE_OBJS) $(TRANSPORT_OBJS) - -SRCS = $(patsubst %.o,$(ICE_DIR)/%.cpp,$(ICE_OBJS)) \ - $(patsubst %.o,$(TRANSPORT_DIR)/%.cpp,$(TRANSPORT_OBJS)) - -SLICE_SRCS = $(SDIR)/BuiltinSequences.ice \ - $(SDIR)/Identity.ice \ - $(SDIR)/Locator.ice \ - $(SDIR)/LocatorF.ice \ - $(SDIR)/Router.ice \ - $(SDIR)/RouterF.ice - -HDIR = $(includedir)/IceE -SDIR = $(slicedir)/IceE - -include $(top_srcdir)/config/Make.rules -ifeq ($(USE_SPARC_ASM),yes) -ASRC = IceAtomic.c -AOBJ = IceAtomic.o -SRCS := $(SRCS) $(ASRCS) -OBJS := $(OBJS) $(AOBJ) -CFLAGS := $(CFLAGS) -fomit-frame-pointer -endif - -$(HDIR)/%.h $(ICE_DIR)/%.cpp: $(SDIR)/%.ice - rm -f $(HDIR)/$(*F).h $(ICE_DIR)/$(*F).cpp - $(SLICE2CPPE) $(SLICE2CPPEFLAGS) $< - mv $(*F).h $(HDIR) - mv $(*F).cpp $(ICE_DIR) - -%.o: $(TRANSPORT_DIR)/%.cpp - $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< - -%.o: $(ICE_DIR)/%.cpp - $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< - - -CPPFLAGS := -I.. $(CPPFLAGS) -DICE_API_EXPORTS -DICEE_PURE_CLIENT - -SLICE2CPPEFLAGS := --ice --include-dir IceE --dll-export ICE_API $(SLICE2CPPEFLAGS) - -LINKWITH := $(ICE_OS_LIBS) - -ifeq ($(STATICLIBS),yes) - -$(libdir)/$(LIBNAME): $(OBJS) - rm -f $@ - $(call mklib,$@,$(OBJS)) - -else - -$(libdir)/$(LIBFILENAME): $(OBJS) - rm -f $@ - $(call mkshlib,$@,$(SONAME),$(OBJS),$(LINKWITH)) - -$(libdir)/$(SONAME): $(libdir)/$(LIBFILENAME) - rm -f $@ - ln -s $(LIBFILENAME) $@ - -$(libdir)/$(LIBNAME): $(libdir)/$(SONAME) - rm -f $@ - ln -s $(SONAME) $@ - -endif - -install:: all - $(call installlib,$(install_libdir),$(libdir),$(LIBFILENAME),$(SONAME),$(LIBNAME)) - -include .depend diff --git a/cppe/src/IceEC/Makefile.mak b/cppe/src/IceEC/Makefile.mak deleted file mode 100644 index f86d72dbc1b..00000000000 --- a/cppe/src/IceEC/Makefile.mak +++ /dev/null @@ -1,132 +0,0 @@ -# **********************************************************************
-#
-# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..\..
-
-LIBNAME = $(top_srcdir)\lib\iceec$(LIBSUFFIX).lib
-DLLNAME = $(top_srcdir)\bin\iceec$(SOVERSION)$(LIBSUFFIX).dll
-
-TARGETS = $(LIBNAME) $(DLLNAME)
-
-TRANSPORT_DIR = $(top_srcdir)\src\TcpTransport
-ICEE_DIR = $(top_srcdir)\src\IceE
-
-TRANSPORT_OBJS = Connector.obj \
- EndpointFactory.obj \
- TcpEndpoint.obj \
- Transceiver.obj
-
-ICEE_OBJS = BasicStream.obj \
- Buffer.obj \
- BuiltinSequences.obj \
- Communicator.obj \
- Cond.obj \
- Connection.obj \
- ConvertUTF.obj \
- DefaultsAndOverrides.obj \
- Endpoint.obj \
- ExceptionBase.obj \
- FactoryTable.obj \
- FactoryTableDef.obj \
- Identity.obj \
- Initialize.obj \
- Instance.obj \
- LocalException.obj \
- Locator.obj \
- LocatorInfo.obj \
- Logger.obj \
- LoggerI.obj \
- LoggerUtil.obj \
- Network.obj \
- OperationMode.obj \
- Outgoing.obj \
- OutgoingConnectionFactory.obj \
- Properties.obj \
- Protocol.obj \
- Proxy.obj \
- ProxyFactory.obj \
- RecMutex.obj \
- Reference.obj \
- ReferenceFactory.obj \
- Router.obj \
- RouterInfo.obj \
- SafeStdio.obj \
- Shared.obj \
- StaticMutex.obj \
- StringConverter.obj \
- StringUtil.obj \
- Thread.obj \
- ThreadException.obj \
- Time.obj \
- TraceLevels.obj \
- TraceUtil.obj \
- UnknownEndpoint.obj \
- Unicode.obj
-
-HDIR = $(includedir)\IceE
-SDIR = $(slicedir)\IceE
-
-!include $(top_srcdir)\config\Make.rules.mak
-
-CPPFLAGS = -I.. $(CPPFLAGS) -DICE_API_EXPORTS -DFD_SETSIZE=1024 -DICEE_PURE_CLIENT -DWIN32_LEAN_AND_MEAN
-SLICE2CPPEFLAGS = --ice --include-dir IceE --dll-export ICE_API $(SLICE2CPPEFLAGS)
-
-!if "$(STATICLIBS)" != "yes" && "$(OPTIMIZE_SPEED)" != "yes" && "$(OPTIMIZE_SIZE)" != "yes"
-PDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb)
-!endif
-
-{$(SDIR)\}.ice{$(HDIR)}.h:
- del /q $(HDIR)\$(*F).h $(ICEE_DIR)\$(*F).cpp
- $(SLICE2CPP) $(SLICE2CPPEFLAGS) $<
- move $(*F).h $(HDIR)
- move $(*F).cpp $(ICEE_DIR)
-
-{$(TRANSPORT_DIR)\}.cpp.obj::
- $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) $<
-
-{$(ICEE_DIR)\}.cpp.obj::
- $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) $<
-
-!if "$(STATICLIBS)" == "yes"
-
-$(DLLNAME):
-
-$(LIBNAME): $(ICEE_OBJS) $(TRANSPORT_OBJS)
- $(AR) $(ARFLAGS) $(PDBFLAGS) $(ICEE_OBJS) $(TRANSPORT_OBJS) /out:$(LIBNAME)
-
-!else
-
-$(LIBNAME): $(DLLNAME)
-
-$(DLLNAME): $(ICEE_OBJS) $(TRANSPORT_OBJS)
- $(LINK) $(LDFLAGS) /dll $(PDBFLAGS) $(ICEE_OBJS) $(TRANSPORT_OBJS) /out:$(DLLNAME) $(BASELIBS)
- move $(DLLNAME:.dll=.lib) $(LIBNAME)
- @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
- $(MT) -nologo -manifest $@.manifest -outputresource:$@;#2 && del /q $@.manifest
- @if exist $(DLLNAME:.dll=.exp) del /q $(DLLNAME:.dll=.exp)
-
-!endif
-
-clean::
- del /q $(LIBNAME:.lib=.*)
-
-install:: all
- copy $(LIBNAME) $(install_libdir)
-
-!if "$(STATICLIBS)" != "yes"
-
-clean::
- del /q $(DLLNAME:.dll=.*)
-
-install:: all
- copy $(DLLNAME) $(install_bindir)
-
-!endif
-
-!include .depend
diff --git a/cppe/src/Makefile b/cppe/src/Makefile deleted file mode 100644 index 074dd98ccf9..00000000000 --- a/cppe/src/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -# -# This copy of Ice-E is licensed to you under the terms described in the -# ICEE_LICENSE file included in this distribution. -# -# ********************************************************************** - -top_srcdir = .. - -include $(top_srcdir)/config/Make.rules - -SUBDIRS = IceE \ - IceEC - -$(EVERYTHING):: - @for subdir in $(SUBDIRS); \ - do \ - echo "making $@ in $$subdir"; \ - ( cd $$subdir && $(MAKE) $@ ) || exit 1; \ - done diff --git a/cppe/src/Makefile.mak b/cppe/src/Makefile.mak deleted file mode 100644 index f5b24b6e38e..00000000000 --- a/cppe/src/Makefile.mak +++ /dev/null @@ -1,21 +0,0 @@ -# **********************************************************************
-#
-# Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ..
-
-!include $(top_srcdir)/config/Make.rules.mak
-
-SUBDIRS = IceE \
- IceEC
-
-$(EVERYTHING)::
- @for %i in ( $(SUBDIRS) ) do \
- @if exist %i \
- @echo "making $@ in %i" && \
- cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
diff --git a/cppe/src/TcpTransport/.depend b/cppe/src/TcpTransport/.depend deleted file mode 100644 index 11c5c9215c1..00000000000 --- a/cppe/src/TcpTransport/.depend +++ /dev/null @@ -1,5 +0,0 @@ -Acceptor.o: Acceptor.cpp ../../include/Ice/Acceptor.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/TransceiverF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/AcceptorF.h ../../include/Ice/Transceiver.h ../Ice/Instance.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/RecMutex.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/EndpointFactoryF.h ../Ice/TraceLevels.h ../../include/Ice/LoggerUtil.h ../Ice/Network.h -Connector.o: Connector.cpp ../../include/Ice/Connector.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/TransceiverF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ConnectorF.h ../../include/Ice/Transceiver.h ../Ice/Instance.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/RecMutex.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/EndpointFactoryF.h ../Ice/TraceLevels.h ../../include/Ice/LoggerUtil.h ../Ice/Network.h -EndpointFactory.o: EndpointFactory.cpp ../../include/Ice/EndpointFactory.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/EndpointF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/InstanceF.h ../../include/Ice/EndpointFactoryF.h ../../include/Ice/Endpoint.h ../../include/Ice/AcceptorF.h ../../include/Ice/ConnectorF.h ../../include/Ice/TransceiverF.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h -Endpoint.o: Endpoint.cpp ../../include/Ice/Endpoint.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/EndpointF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/AcceptorF.h ../../include/Ice/ConnectorF.h ../../include/Ice/TransceiverF.h ../../include/Ice/InstanceF.h ../Ice/Network.h ../../include/Ice/Acceptor.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/Connector.h ../../include/Ice/Transceiver.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/LocalException.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/BuiltinSequences.h ../Ice/Instance.h ../../include/IceUtil/RecMutex.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/EndpointFactoryF.h ../Ice/DefaultsAndOverrides.h ../../include/IceUtil/SafeStdio.h -Transceiver.o: Transceiver.cpp ../../include/Ice/Transceiver.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../Ice/TraceLevelsF.h ../../include/Ice/LoggerF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/TransceiverF.h ../Ice/Instance.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/RecMutex.h ../../include/Ice/CommunicatorF.h ../../include/Ice/PropertiesF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ObjectAdapterFactoryF.h ../../include/Ice/EndpointFactoryF.h ../Ice/TraceLevels.h ../../include/Ice/LoggerUtil.h ../../include/Ice/Buffer.h ../Ice/Network.h ../../include/Ice/LocalException.h ../../include/Ice/Proxy.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointF.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/BuiltinSequences.h ../../include/IceUtil/SafeStdio.h diff --git a/cppe/src/TcpTransport/Acceptor.cpp b/cppe/src/TcpTransport/Acceptor.cpp deleted file mode 100644 index b32928219ec..00000000000 --- a/cppe/src/TcpTransport/Acceptor.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Acceptor.h> -#include <IceE/Transceiver.h> -#include <IceE/Instance.h> -#include <IceE/TraceLevels.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Network.h> -#include <IceE/Exception.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Acceptor* p) { return p; } - -SOCKET -IceInternal::Acceptor::fd() -{ - return _fd; -} - -void -IceInternal::Acceptor::close() -{ - if(_traceLevels->network >= 1) - { - Trace out(_logger, _traceLevels->networkCat); - out << "stopping to accept tcp connections at " << toString(); - } - - SOCKET fd = _fd; - _fd = INVALID_SOCKET; - closeSocket(fd); -} - -void -IceInternal::Acceptor::listen() -{ - try - { - doListen(_fd, _backlog); - } - catch(...) - { - _fd = INVALID_SOCKET; - throw; - } - - if(_traceLevels->network >= 1) - { - Trace out(_logger, _traceLevels->networkCat); - out << "accepting tcp connections at " << toString(); - } -} - -TransceiverPtr -IceInternal::Acceptor::accept() -{ - SOCKET fd = doAccept(_fd); -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - setBlock(fd, true); -#endif - setTcpBufSize(fd, _instance->initializationData().properties, _logger); - - if(_traceLevels->network >= 1) - { - Trace out(_logger, _traceLevels->networkCat); - out << "accepted tcp connection\n" << fdToString(fd); - } - - return new Transceiver(_instance, fd); -} - -void -IceInternal::Acceptor::connectToSelf() -{ - SOCKET fd = createSocket(); - setBlock(fd, false); - doConnect(fd, _addr, -1); - closeSocket(fd); -} - -string -IceInternal::Acceptor::toString() const -{ - return addrToString(_addr); -} - -int -IceInternal::Acceptor::effectivePort() -{ - return ntohs(_addr.sin_port); -} - -IceInternal::Acceptor::Acceptor(const InstancePtr& instance, const string& host, int port) : - _instance(instance), - _traceLevels(instance->traceLevels()), - _logger(instance->initializationData().logger), - _backlog(0) -{ - if(_backlog <= 0) - { - _backlog = 5; - } - - try - { - _fd = createSocket(); - getAddress(host, port, _addr); - setTcpBufSize(_fd, _instance->initializationData().properties, _logger); -#ifndef _WIN32 - // - // Enable SO_REUSEADDR on Unix platforms to allow re-using the - // socket even if it's in the TIME_WAIT state. On Windows, - // this doesn't appear to be necessary and enabling - // SO_REUSEADDR would actually not be a good thing since it - // allows a second process to bind to an address even it's - // already bound by another process. - // - // TODO: using SO_EXCLUSIVEADDRUSE on Windows would probably - // be better but it's only supported by recent Windows - // versions (XP SP2, Windows Server 2003). - // - setReuseAddress(_fd, true); -#endif - if(_traceLevels->network >= 2) - { - Trace out(_logger, _traceLevels->networkCat); - out << "attempting to bind to tcp socket " << toString(); - } - doBind(_fd, _addr); - } - catch(...) - { - _fd = INVALID_SOCKET; - throw; - } -} - -IceInternal::Acceptor::~Acceptor() -{ - assert(_fd == INVALID_SOCKET); -} diff --git a/cppe/src/TcpTransport/Connector.cpp b/cppe/src/TcpTransport/Connector.cpp deleted file mode 100644 index 04d44e49322..00000000000 --- a/cppe/src/TcpTransport/Connector.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Connector.h> -#include <IceE/Transceiver.h> -#include <IceE/Instance.h> -#include <IceE/TraceLevels.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Network.h> -#include <IceE/Exception.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Connector* p) { return p; } - -TransceiverPtr -Connector::connect(int timeout) -{ - if(_traceLevels->network >= 2) - { - Trace out(_logger, _traceLevels->networkCat); - out << "trying to establish tcp connection to " << toString(); - } - - SOCKET fd = createSocket(); - setBlock(fd, false); - setTcpBufSize(fd, _instance->initializationData().properties, _logger); - doConnect(fd, _addr, timeout); -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - setBlock(fd, true); -#endif - - if(_traceLevels->network >= 1) - { - Trace out(_logger, _traceLevels->networkCat); - out << "tcp connection established\n" << fdToString(fd); - } - - return new Transceiver(_instance, fd); -} - -string -Connector::toString() const -{ - return addrToString(_addr); -} - -Connector::Connector(const InstancePtr& instance, const string& host, int port) : - _instance(instance), - _traceLevels(instance->traceLevels()), - _logger(instance->initializationData().logger) -{ - getAddress(host, port, _addr); -} - -Connector::~Connector() -{ -} diff --git a/cppe/src/TcpTransport/EndpointFactory.cpp b/cppe/src/TcpTransport/EndpointFactory.cpp deleted file mode 100644 index 0c865dcc887..00000000000 --- a/cppe/src/TcpTransport/EndpointFactory.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/EndpointFactory.h> -#include <IceE/UnknownEndpoint.h> -#include <IceE/LocalException.h> -#include <IceE/BasicStream.h> -#include <TcpTransport/TcpEndpoint.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(EndpointFactory* p) { return p; } - -IceInternal::EndpointFactory::EndpointFactory(const InstancePtr& instance) - : _instance(instance) -{ -} - -IceInternal::EndpointFactory::~EndpointFactory() -{ -} - -EndpointPtr -IceInternal::EndpointFactory::create(const std::string& str) const -{ - const string delim = " \t\n\r"; - - string::size_type beg = str.find_first_not_of(delim); - if(beg == string::npos) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = str; - throw ex; - } - - string::size_type end = str.find_first_of(delim, beg); - if(end == string::npos) - { - end = str.length(); - } - - string protocol = str.substr(beg, end - beg); - - if(protocol == "default" || protocol == "tcp") - { - return new TcpEndpoint(_instance, str.substr(end)); - } - - return 0; -} - -EndpointPtr -IceInternal::EndpointFactory::read(BasicStream* s) const -{ - Short type; - s->read(type); - - if(type == TcpEndpointType) - { - return new TcpEndpoint(s); - } - - return new UnknownEndpoint(type, s); -} - -void -IceInternal::EndpointFactory::destroy() -{ - _instance = 0; -} diff --git a/cppe/src/TcpTransport/TcpEndpoint.cpp b/cppe/src/TcpTransport/TcpEndpoint.cpp deleted file mode 100644 index e41d7d2efe1..00000000000 --- a/cppe/src/TcpTransport/TcpEndpoint.cpp +++ /dev/null @@ -1,406 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <TcpTransport/TcpEndpoint.h> -#include <IceE/Network.h> -#include <IceE/Connector.h> -#include <IceE/Transceiver.h> -#include <IceE/BasicStream.h> -#include <IceE/LocalException.h> -#include <IceE/Instance.h> -#include <IceE/DefaultsAndOverrides.h> -#include <IceE/SafeStdio.h> -#ifndef ICEE_PURE_CLIENT -# include <IceE/Acceptor.h> -#endif - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& ho, Int po, Int ti, bool pub) : - _instance(instance), - _host(ho), - _port(po), - _timeout(ti), - _publish(pub) -{ -} - -IceInternal::TcpEndpoint::TcpEndpoint(const InstancePtr& instance, const string& str) : - _instance(instance), - _port(0), - _timeout(-1), - _publish(true) -{ - const string delim = " \t\n\r"; - - string::size_type beg; - string::size_type end = 0; - - while(true) - { - beg = str.find_first_not_of(delim, end); - if(beg == string::npos) - { - break; - } - - end = str.find_first_of(delim, beg); - if(end == string::npos) - { - end = str.length(); - } - - string option = str.substr(beg, end - beg); - if(option.length() != 2 || option[0] != '-') - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "tcp " + str; - throw ex; - } - - string argument; - string::size_type argumentBeg = str.find_first_not_of(delim, end); - if(argumentBeg != string::npos && str[argumentBeg] != '-') - { - beg = argumentBeg; - end = str.find_first_of(delim, beg); - if(end == string::npos) - { - end = str.length(); - } - argument = str.substr(beg, end - beg); - } - - switch(option[1]) - { - case 'h': - { - if(argument.empty()) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "tcp " + str; - throw ex; - } - const_cast<string&>(_host) = argument; - break; - } - - case 'p': - { - const_cast<Int&>(_port) = atoi(argument.c_str()); - if(_port <= 0 || _port > 65535) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "tcp " + str; - throw ex; - } - break; - } - - case 't': - { - const_cast<Int&>(_timeout) = atoi(argument.c_str()); - if(_timeout == 0) - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "tcp " + str; - throw ex; - } - break; - } - - case 'z': - { - // Ignore compression flag. - break; - } - - default: - { - EndpointParseException ex(__FILE__, __LINE__); - ex.str = "tcp " + str; - throw ex; - } - } - } -} - -IceInternal::TcpEndpoint::TcpEndpoint(BasicStream* s) : - _instance(s->instance()), - _port(0), - _timeout(-1), - _publish(true) -{ - bool dummy; - - s->startReadEncaps(); - s->read(const_cast<string&>(_host), false); - s->read(const_cast<Int&>(_port)); - s->read(const_cast<Int&>(_timeout)); - s->read(const_cast<bool&>(dummy)); - s->endReadEncaps(); -} - -void -IceInternal::TcpEndpoint::streamWrite(BasicStream* s) const -{ - s->write(TcpEndpointType); - s->startWriteEncaps(); - s->write(_host, false); - s->write(_port); - s->write(_timeout); - s->write(false); - s->endWriteEncaps(); -} - -string -IceInternal::TcpEndpoint::toString() const -{ - string s; - s += "tcp -h "; - s += _host; - - s += Ice::printfToString(" -p %d", _port); - - if(_timeout != -1) - { - s += Ice::printfToString(" -t %d", _timeout); - } - return s; -} - -Short -IceInternal::TcpEndpoint::type() const -{ - return TcpEndpointType; -} - -Int -IceInternal::TcpEndpoint::timeout() const -{ - return _timeout; -} - -EndpointPtr -IceInternal::TcpEndpoint::timeout(Int timeout) const -{ - if(timeout == _timeout) - { - return const_cast<TcpEndpoint*>(this); - } - else - { - return new TcpEndpoint(_instance, _host, _port, timeout, _publish); - } -} - -bool -IceInternal::TcpEndpoint::secure() const -{ - return false; -} - -bool -IceInternal::TcpEndpoint::datagram() const -{ - return false; -} - -bool -IceInternal::TcpEndpoint::unknown() const -{ - return false; -} - -ConnectorPtr -IceInternal::TcpEndpoint::connector() const -{ - return new Connector(_instance, _host, _port); -} - -bool -IceInternal::TcpEndpoint::operator==(const Endpoint& r) const -{ - const TcpEndpoint* p = dynamic_cast<const TcpEndpoint*>(&r); - if(!p) - { - return false; - } - - if(this == p) - { - return true; - } - - if(_port != p->_port) - { - return false; - } - - if(_timeout != p->_timeout) - { - return false; - } - - if(_host != p->_host) - { - // - // We do the most time-consuming part of the comparison last. - // - struct sockaddr_in laddr; - struct sockaddr_in raddr; - try - { - getAddress(_host, _port, laddr); - getAddress(p->_host, p->_port, raddr); - } - catch(const DNSException&) - { - return false; - } - - return compareAddress(laddr, raddr); - } - - return true; -} - -bool -IceInternal::TcpEndpoint::operator!=(const Endpoint& r) const -{ - return !operator==(r); -} - -bool -IceInternal::TcpEndpoint::operator<(const Endpoint& r) const -{ - const TcpEndpoint* p = dynamic_cast<const TcpEndpoint*>(&r); - if(!p) - { - return type() < r.type(); - } - - if(this == p) - { - return false; - } - - if(_port < p->_port) - { - return true; - } - else if(p->_port < _port) - { - return false; - } - - if(_timeout < p->_timeout) - { - return true; - } - else if(p->_timeout < _timeout) - { - return false; - } - - if(_host != p->_host) - { - // - // We do the most time-consuming part of the comparison last. - // - struct sockaddr_in laddr; - try - { - getAddress(_host, _port, laddr); - } - catch(const DNSException&) - { - } - - struct sockaddr_in raddr; - try - { - getAddress(p->_host, p->_port, raddr); - } - catch(const DNSException&) - { - } - - if(laddr.sin_addr.s_addr < raddr.sin_addr.s_addr) - { - return true; - } - else if(raddr.sin_addr.s_addr < laddr.sin_addr.s_addr) - { - return false; - } - } - - return false; -} - -vector<EndpointPtr> -IceInternal::TcpEndpoint::expand(bool server) const -{ - if(_host.empty()) - { - const_cast<string&>(_host) = _instance->defaultsAndOverrides()->defaultHost; - if(_host.empty()) - { - if(server) - { - const_cast<string&>(_host) = "0.0.0.0"; - } - else - { - const_cast<string&>(_host) = "127.0.0.1"; - } - } - } - else if(_host == "*") - { - const_cast<string&>(_host) = "0.0.0.0"; - } - - vector<EndpointPtr> endps; - if(_host == "0.0.0.0") - { - 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")); - } - } - else - { - endps.push_back(const_cast<TcpEndpoint*>(this)); - } - 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 -{ - return _publish; -} - -#endif diff --git a/cppe/src/TcpTransport/TcpEndpoint.h b/cppe/src/TcpTransport/TcpEndpoint.h deleted file mode 100644 index 153a7701897..00000000000 --- a/cppe/src/TcpTransport/TcpEndpoint.h +++ /dev/null @@ -1,61 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#ifndef ICEE_TRANSPORT_TCP_ENDPOINT_H -#define ICEE_TRANSPORT_TCP_ENDPOINT_H - -#include <IceE/Endpoint.h> - -namespace IceInternal -{ - -const Ice::Short TcpEndpointType = 1; - -class TcpEndpoint : public IceInternal::Endpoint -{ -public: - - TcpEndpoint(const InstancePtr&, const std::string&, Ice::Int, Ice::Int, bool); - TcpEndpoint(const InstancePtr&, const std::string&); - TcpEndpoint(BasicStream*); - - virtual void streamWrite(BasicStream*) const; - virtual std::string toString() const; - virtual Ice::Short type() const; - virtual Ice::Int timeout() const; - virtual EndpointPtr timeout(Ice::Int) const; - virtual bool secure() const; - virtual bool datagram() const; - virtual bool unknown() const; - virtual ConnectorPtr connector() const; -#ifndef ICEE_PURE_CLIENT - virtual AcceptorPtr acceptor(EndpointPtr&) const; - virtual bool publish() const; -#endif - virtual std::vector<EndpointPtr> expand(bool) const; - - virtual bool operator==(const Endpoint&) const; - virtual bool operator!=(const Endpoint&) const; - virtual bool operator<(const Endpoint&) const; - -private: - - // - // All members are const, because endpoints are immutable. - // - const InstancePtr _instance; - const std::string _host; - const Ice::Int _port; - const Ice::Int _timeout; - const bool _publish; -}; - -} - -#endif diff --git a/cppe/src/TcpTransport/Transceiver.cpp b/cppe/src/TcpTransport/Transceiver.cpp deleted file mode 100644 index 8f0d18b5f4c..00000000000 --- a/cppe/src/TcpTransport/Transceiver.cpp +++ /dev/null @@ -1,612 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/Transceiver.h> -#include <IceE/Instance.h> -#include <IceE/TraceLevels.h> -#include <IceE/LoggerUtil.h> -#include <IceE/Buffer.h> -#include <IceE/Network.h> -#include <IceE/LocalException.h> -#include <IceE/SafeStdio.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -IceUtil::Shared* IceInternal::upCast(Transceiver* p) { return p; } - -void -IceInternal::Transceiver::setTimeouts(int readTimeout, int writeTimeout) -{ - _readTimeout = readTimeout; -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - setTimeout(_fd, true, _readTimeout); -#endif - - _writeTimeout = writeTimeout; -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - setTimeout(_fd, false, _writeTimeout); -#endif -} - -SOCKET -IceInternal::Transceiver::fd() -{ - assert(_fd != INVALID_SOCKET); - return _fd; -} - -void -IceInternal::Transceiver::close() -{ - if(_traceLevels->network >= 1) - { - Trace out(_logger, _traceLevels->networkCat); - out << "closing tcp connection\n" << toString(); - } - -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -#ifdef _WIN32 - assert(_event != 0); - WSACloseEvent(_event); - WSACloseEvent(_readEvent); - WSACloseEvent(_writeEvent); - _event = 0; - _readEvent = 0; - _writeEvent = 0; -#endif -#endif - - assert(_fd != INVALID_SOCKET); - try - { - closeSocket(_fd); - _fd = INVALID_SOCKET; - } - catch(const SocketException&) - { - _fd = INVALID_SOCKET; - throw; - } -} - -void -IceInternal::Transceiver::shutdownWrite() -{ - if(_traceLevels->network >= 2) - { - Trace out(_logger, _traceLevels->networkCat); - out << "shutting down tcp connection for writing\n" << toString(); - } - - assert(_fd != INVALID_SOCKET); - shutdownSocketWrite(_fd); -} - -void -IceInternal::Transceiver::shutdownReadWrite() -{ - if(_traceLevels->network >= 2) - { - Trace out(_logger, _traceLevels->networkCat); - out << "shutting down tcp connection for reading and writing\n" << toString(); - } - - assert(_fd != INVALID_SOCKET); - shutdownSocketReadWrite(_fd); -} - -void -IceInternal::Transceiver::writeWithTimeout(Buffer& buf, int timeout) -{ - Buffer::Container::difference_type packetSize = - static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i); - -#ifdef _WIN32 - // - // Limit packet size to avoid performance problems on WIN32 - // - if(packetSize > _maxPacketSize) - { - packetSize = _maxPacketSize; - } -#endif - -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - if(timeout > 0 && timeout != _writeTimeout) - { - setTimeout(_fd, false, timeout); - } - - try - { -#endif - while(buf.i != buf.b.end()) - { - repeatSend: - assert(_fd != INVALID_SOCKET); - ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&*buf.i), packetSize, 0); - - if(ret == 0) - { - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = 0; - throw ex; - } - - if(ret == SOCKET_ERROR) - { - if(interrupted()) - { - goto repeatSend; - } - - if(noBuffers() && packetSize > 1024) - { - packetSize /= 2; - goto repeatSend; - } - -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - if(timedout()) - { - throw TimeoutException(__FILE__, __LINE__); - } -#else - if(wouldBlock()) - { - doSelect(false, timeout > 0 ? timeout : _writeTimeout); - continue; - } -#endif - - if(connectionLost()) - { - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - - if(_traceLevels->network >= 3) - { - Trace out(_logger, _traceLevels->networkCat); - out << Ice::printfToString("sent %d of %d", ret, packetSize) << " bytes via tcp\n" << toString(); - } - - buf.i += ret; - - if(packetSize > buf.b.end() - buf.i) - { - packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i); - } - } -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - } - catch(const Ice::LocalException&) - { - if(timeout > 0 && timeout != _writeTimeout) - { - try - { - setTimeout(_fd, false, _writeTimeout); - } - catch(const Ice::LocalException&) - { - // IGNORE - } - } - throw; - } - - if(timeout > 0 && timeout != _writeTimeout) - { - try - { - setTimeout(_fd, false, _writeTimeout); - } - catch(const Ice::LocalException&) - { - // IGNORE - } - } -#endif -} - -void -IceInternal::Transceiver::readWithTimeout(Buffer& buf, int timeout) -{ - assert(timeout != 0); - - Buffer::Container::difference_type packetSize = - static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i); - -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - if(timeout > 0 && timeout != _readTimeout) - { - setTimeout(_fd, true, timeout); - } - try - { -#endif - while(buf.i != buf.b.end()) - { - repeatRead: - assert(_fd != INVALID_SOCKET); - ssize_t ret = ::recv(_fd, reinterpret_cast<char*>(&*buf.i), packetSize, 0); - - if(ret == 0) - { - // - // If the connection is lost when reading data, we shut - // down the write end of the socket. This helps to unblock - // threads that are stuck in send() or select() while - // sending data. Note: I don't really understand why - // send() or select() sometimes don't detect a connection - // loss. Therefore this helper to make them detect it. - // - //assert(_fd != INVALID_SOCKET); - //shutdownSocketReadWrite(_fd); - - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = 0; - throw ex; - } - - if(ret == SOCKET_ERROR) - { - if(interrupted()) - { - goto repeatRead; - } - - if(noBuffers() && packetSize > 1024) - { - packetSize /= 2; - goto repeatRead; - } - -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - if(timedout()) - { - throw TimeoutException(__FILE__, __LINE__); - } -#else - if(wouldBlock()) - { - doSelect(true, timeout > 0 ? timeout : _readTimeout); - continue; - } -#endif - - if(connectionLost()) - { - // - // See the commment above about shutting down the - // socket if the connection is lost while reading - // data. - // - //assert(_fd != INVALID_SOCKET); - //shutdownSocketReadWrite(_fd); - - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - - if(_traceLevels->network >= 3) - { - Trace out(_logger, _traceLevels->networkCat); - out << Ice::printfToString("received %d of %d", ret, packetSize) << " bytes via tcp\n" << toString(); - } - - buf.i += ret; - - if(packetSize > buf.b.end() - buf.i) - { - packetSize = static_cast<Buffer::Container::difference_type>(buf.b.end() - buf.i); - } - } -#ifndef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS - } - catch(const Ice::LocalException&) - { - if(timeout > 0 && timeout != _readTimeout) - { - try - { - setTimeout(_fd, true, _readTimeout); - } - catch(const Ice::LocalException&) - { - // IGNORE - } - } - throw; - } - - if(timeout > 0 && timeout != _readTimeout) - { - try - { - setTimeout(_fd, true, _readTimeout); - } - catch(const Ice::LocalException&) - { - // IGNORE - } - } -#endif -} - -string -IceInternal::Transceiver::type() const -{ - return "tcp"; -} - -string -IceInternal::Transceiver::toString() const -{ - return _desc; -} - -IceInternal::Transceiver::Transceiver(const InstancePtr& instance, SOCKET fd) : - _traceLevels(instance->traceLevels()), - _logger(instance->initializationData().logger), - _fd(fd), - _readTimeout(-1), - _writeTimeout(-1), - _desc(fdToString(fd)) -{ -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -#ifdef _WIN32 - _event = WSACreateEvent(); - _readEvent = WSACreateEvent(); - _writeEvent = WSACreateEvent(); - if(_event == 0 || _readEvent == 0 || _writeEvent == 0) - { - int error = WSAGetLastError(); - if(_event != 0) - { - WSACloseEvent(_event); - } - if(_readEvent != 0) - { - WSACloseEvent(_readEvent); - } - if(_writeEvent != 0) - { - WSACloseEvent(_writeEvent); - } - closeSocket(_fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } - - // - // Select the READ, WRITE and CLOSE for trigging. - // - if(WSAEventSelect(_fd, _event, FD_READ|FD_WRITE|FD_CLOSE) == SOCKET_ERROR) - { - int error = WSAGetLastError(); - - WSACloseEvent(_event); - WSACloseEvent(_readEvent); - WSACloseEvent(_writeEvent); - closeSocket(_fd); - - SocketException ex(__FILE__, __LINE__); - ex.error = error; - throw ex; - } -#else - FD_ZERO(&_wFdSet); - FD_ZERO(&_rFdSet); -#endif -#endif - -#ifdef _WIN32 - // - // On Windows, limiting the buffer size is important to prevent - // poor throughput performances when transfering large amount of - // data. See Microsoft KB article KB823764. - // - _maxPacketSize = getSendBufferSize(_fd) / 2; - if(_maxPacketSize < 512) - { - _maxPacketSize = 512; // Make sure the packet size limiter isn't too small. - } -#endif -} - -IceInternal::Transceiver::~Transceiver() -{ - assert(_fd == INVALID_SOCKET); -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -#ifdef _WIN32 - assert(_event == 0); - assert(_readEvent == 0); - assert(_writeEvent == 0); -#endif -#endif -} - -#ifdef ICEE_USE_SELECT_OR_POLL_FOR_TIMEOUTS -void -IceInternal::Transceiver::doSelect(bool read, int timeout) -{ - while(true) - { -#ifdef _WIN32 - // - // This code is basically the same as the code in - // ::send above. Check that for detailed comments. - // - WSAEVENT events[2]; - events[0] = _event; - events[1] = read ? _readEvent : _writeEvent; - long tout = (timeout >= 0) ? timeout : WSA_INFINITE; - DWORD rc = WSAWaitForMultipleEvents(2, events, FALSE, tout, FALSE); - if(rc == WSA_WAIT_FAILED) - { - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } - if(rc == WSA_WAIT_TIMEOUT) - { - assert(timeout >= 0); - throw TimeoutException(__FILE__, __LINE__); - } - - if(rc == WSA_WAIT_EVENT_0) - { - WSANETWORKEVENTS nevents; - if(WSAEnumNetworkEvents(_fd, _event, &nevents) == SOCKET_ERROR) - { - SocketException ex(__FILE__, __LINE__); - ex.error = WSAGetLastError(); - throw ex; - } - - // - // If we're selecting for reading and have consumed a WRITE - // event, set the _writeEvent event. Otherwise, if we're - // selecting for writing have consumed a READ event, set the - // _readEvent event. - // - if(read && nevents.lNetworkEvents & FD_WRITE) - { - WSASetEvent(_writeEvent); - } - else if(!read && nevents.lNetworkEvents & FD_READ) - { - WSASetEvent(_readEvent); - } - - - // - // This checks for an error on the fd (this would - // be same as recv itself returning an error). In - // the event of an error we set the error code, - // and repeat the error handling. - // - if(read && nevents.lNetworkEvents & FD_READ && nevents.iErrorCode[FD_READ_BIT] != 0) - { - WSASetLastError(nevents.iErrorCode[FD_READ_BIT]); - } - else if(!read && nevents.lNetworkEvents & FD_WRITE && nevents.iErrorCode[FD_WRITE_BIT] != 0) - { - WSASetLastError(nevents.iErrorCode[FD_WRITE_BIT]); - } - else if(nevents.lNetworkEvents & FD_CLOSE && nevents.iErrorCode[FD_CLOSE_BIT] != 0) - { - WSASetLastError(nevents.iErrorCode[FD_CLOSE_BIT]); - } - else - { - return; // No errors: we're done. - } - - if(interrupted()) - { - continue; - } - - if(connectionLost()) - { - // - // See the commment above about shutting down the - // socket if the connection is lost while reading - // data. - // - //assert(_fd != INVALID_SOCKET); - //shutdownSocketReadWrite(_fd); - - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - else - { - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - } - else - { - // - // Otherwise the _readEvent or _writeEvent is set, reset it. - // - if(read) - { - WSAResetEvent(_readEvent); - } - else - { - WSAResetEvent(_writeEvent); - } - return; - } -#else - int rs; - assert(_fd != INVALID_SOCKET); - if(read) - { - FD_SET(_fd, &_rFdSet); - } - else - { - FD_SET(_fd, &_wFdSet); - } - - struct pollfd pollFd[1]; - pollFd[0].fd = _fd; - pollFd[0].events = read ? POLLIN : POLLOUT; - rs = ::poll(pollFd, 1, timeout); - if(rs == SOCKET_ERROR) - { - if(interrupted()) - { - continue; - } - - SocketException ex(__FILE__, __LINE__); - ex.error = getSocketErrno(); - throw ex; - } - - if(rs == 0) - { - throw TimeoutException(__FILE__, __LINE__); - } - - return; -#endif - } -} -#endif |