zeroc-ice 3.6.5 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/BZIP2_LICENSE +42 -0
- data/ICE_LICENSE +17 -17
- data/LICENSE +12 -12
- data/bin/slice2rb +1 -1
- data/ext/Communicator.cpp +150 -53
- data/ext/Communicator.h +1 -1
- data/ext/Config.h +2 -12
- data/ext/Connection.cpp +89 -68
- data/ext/Connection.h +1 -1
- data/ext/Endpoint.cpp +16 -45
- data/ext/Endpoint.h +1 -1
- data/ext/ImplicitContext.cpp +1 -5
- data/ext/ImplicitContext.h +1 -1
- data/ext/Init.cpp +4 -1
- data/ext/Logger.cpp +1 -1
- data/ext/Logger.h +1 -1
- data/ext/Operation.cpp +33 -44
- data/ext/Operation.h +1 -1
- data/ext/Properties.cpp +1 -1
- data/ext/Properties.h +1 -1
- data/ext/Proxy.cpp +22 -57
- data/ext/Proxy.h +1 -1
- data/ext/Slice.cpp +5 -5
- data/ext/Slice.h +1 -1
- data/ext/Types.cpp +244 -171
- data/ext/Types.h +118 -66
- data/ext/Util.cpp +13 -9
- data/ext/Util.h +10 -10
- data/ext/ValueFactoryManager.cpp +445 -0
- data/ext/ValueFactoryManager.h +100 -0
- data/ext/extconf.rb +47 -45
- data/ext/ice/bzip2/blocksort.c +1094 -0
- data/ext/ice/bzip2/bzlib.c +1572 -0
- data/ext/ice/bzip2/bzlib.h +282 -0
- data/ext/ice/bzip2/bzlib_private.h +509 -0
- data/ext/ice/bzip2/compress.c +672 -0
- data/ext/ice/bzip2/crctable.c +104 -0
- data/ext/ice/bzip2/decompress.c +646 -0
- data/ext/ice/bzip2/huffman.c +205 -0
- data/ext/ice/bzip2/randtable.c +84 -0
- data/ext/ice/cpp/include/Ice/Application.h +77 -60
- data/ext/ice/cpp/include/Ice/AsyncResult.h +34 -318
- data/ext/ice/cpp/include/Ice/AsyncResultF.h +4 -2
- data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +5 -10
- data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +1 -1
- data/ext/ice/cpp/include/Ice/Buffer.h +10 -10
- data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +14 -12
- data/ext/ice/cpp/include/Ice/Comparable.h +130 -0
- data/ext/ice/cpp/include/Ice/Config.h +7 -36
- data/ext/ice/cpp/include/Ice/ConnectionAsync.h +107 -11
- data/ext/ice/cpp/include/Ice/ConnectionIF.h +5 -1
- data/ext/ice/cpp/include/Ice/ConsoleUtil.h +28 -0
- data/ext/ice/cpp/include/Ice/{DefaultObjectFactory.h → DefaultValueFactory.h} +28 -14
- data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +4 -6
- data/ext/ice/cpp/include/Ice/Dispatcher.h +14 -13
- data/ext/ice/cpp/include/Ice/DynamicLibrary.h +7 -5
- data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +1 -1
- data/ext/ice/cpp/include/Ice/Exception.h +66 -56
- data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +69 -0
- data/ext/ice/cpp/include/Ice/FactoryTable.h +11 -12
- data/ext/ice/cpp/include/Ice/FactoryTableInit.h +27 -25
- data/ext/ice/cpp/include/Ice/Format.h +6 -1
- data/ext/ice/cpp/include/Ice/Functional.h +33 -33
- data/ext/ice/cpp/include/Ice/GCObject.h +9 -5
- data/ext/ice/cpp/include/Ice/Handle.h +6 -11
- data/ext/ice/cpp/include/Ice/Ice.h +9 -5
- data/ext/ice/cpp/include/{IceUtil → Ice}/IconvStringConverter.h +108 -62
- data/ext/ice/cpp/include/Ice/Incoming.h +109 -33
- data/ext/ice/cpp/include/Ice/IncomingAsync.h +63 -23
- data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +7 -1
- data/ext/ice/cpp/include/Ice/Initialize.h +178 -38
- data/ext/ice/cpp/include/Ice/InputStream.h +994 -0
- data/ext/ice/cpp/include/Ice/InstanceF.h +1 -2
- data/ext/ice/cpp/include/Ice/InterfaceByValue.h +46 -0
- data/ext/ice/cpp/include/Ice/LocalObject.h +9 -9
- data/ext/ice/cpp/include/Ice/LocalObjectF.h +1 -1
- data/ext/ice/cpp/include/Ice/LoggerUtil.h +20 -14
- data/ext/ice/cpp/include/Ice/MetricsAdminI.h +114 -65
- data/ext/ice/cpp/include/Ice/MetricsFunctional.h +23 -5
- data/ext/ice/cpp/include/Ice/MetricsObserverI.h +99 -26
- data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +17 -4
- data/ext/ice/cpp/include/Ice/Object.h +105 -56
- data/ext/ice/cpp/include/Ice/ObjectF.h +8 -3
- data/ext/ice/cpp/include/Ice/ObserverHelper.h +18 -8
- data/ext/ice/cpp/include/Ice/Optional.h +1084 -0
- data/ext/ice/cpp/include/Ice/OutgoingAsync.h +655 -84
- data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +12 -6
- data/ext/ice/cpp/include/Ice/OutputStream.h +753 -0
- data/ext/ice/cpp/include/Ice/Protocol.h +19 -12
- data/ext/ice/cpp/include/Ice/Proxy.h +1329 -717
- data/ext/ice/cpp/include/Ice/ProxyF.h +11 -33
- data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +1 -1
- data/ext/ice/cpp/include/Ice/ProxyHandle.h +34 -50
- data/ext/ice/cpp/include/Ice/ReferenceF.h +1 -1
- data/ext/ice/cpp/include/Ice/RegisterPlugins.h +22 -3
- data/ext/ice/cpp/include/Ice/RequestHandlerF.h +10 -4
- data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +6 -1
- data/ext/ice/cpp/include/{IceUtil → Ice}/SHA1.h +16 -16
- data/ext/ice/cpp/include/Ice/ServantManagerF.h +1 -1
- data/ext/ice/cpp/include/Ice/Service.h +13 -18
- data/ext/ice/cpp/include/Ice/SliceChecksums.h +1 -1
- data/ext/ice/cpp/include/Ice/SlicedData.h +46 -20
- data/ext/ice/cpp/include/Ice/SlicedDataF.h +14 -6
- data/ext/ice/cpp/include/Ice/StreamHelpers.h +159 -49
- data/ext/ice/cpp/include/Ice/StringConverter.h +52 -0
- data/ext/ice/cpp/include/Ice/ThreadPoolF.h +1 -1
- data/{slice/Ice/ObjectFactoryF.ice → ext/ice/cpp/include/Ice/UUID.h} +9 -7
- data/ext/ice/cpp/include/{IceUtil → Ice}/UniquePtr.h +21 -22
- data/ext/ice/cpp/include/Ice/UniqueRef.h +98 -0
- data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +40 -8
- data/ext/ice/cpp/include/Ice/Value.h +104 -0
- data/{slice/Freeze/ConnectionF.ice → ext/ice/cpp/include/Ice/ValueF.h} +11 -7
- data/ext/ice/cpp/include/IceSSL/Config.h +8 -23
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +17 -6
- data/ext/ice/cpp/include/IceSSL/OpenSSL.h +130 -0
- data/ext/ice/cpp/include/IceSSL/Plugin.h +172 -259
- data/ext/ice/cpp/include/IceSSL/SChannel.h +66 -0
- data/ext/ice/cpp/include/IceSSL/SecureTransport.h +66 -0
- data/ext/ice/cpp/include/IceSSL/UWP.h +58 -0
- data/ext/ice/cpp/include/IceUtil/Atomic.h +8 -10
- data/ext/ice/cpp/include/IceUtil/Cond.h +17 -18
- data/ext/ice/cpp/include/IceUtil/Config.h +138 -39
- data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +97 -0
- data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +5 -5
- data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +23 -17
- data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +1 -3
- data/ext/ice/cpp/include/IceUtil/Exception.h +157 -67
- data/ext/ice/cpp/include/IceUtil/FileUtil.h +148 -0
- data/ext/ice/cpp/include/IceUtil/Functional.h +1 -2
- data/ext/ice/cpp/include/IceUtil/Handle.h +11 -11
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +4 -10
- data/ext/ice/cpp/include/IceUtil/InputUtil.h +3 -3
- data/ext/ice/cpp/include/IceUtil/Iterator.h +2 -2
- data/ext/ice/cpp/include/IceUtil/Lock.h +8 -10
- data/ext/ice/cpp/include/IceUtil/Monitor.h +1 -2
- data/ext/ice/cpp/include/IceUtil/Mutex.h +17 -11
- data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +2 -2
- data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +4 -4
- data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +4 -4
- data/ext/ice/cpp/include/IceUtil/Optional.h +32 -18
- data/ext/ice/cpp/include/IceUtil/Options.h +17 -18
- data/ext/ice/cpp/include/IceUtil/OutputUtil.h +55 -29
- data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +6 -6
- data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +11 -10
- data/ext/ice/cpp/include/IceUtil/Random.h +3 -3
- data/ext/ice/cpp/include/IceUtil/RecMutex.h +7 -8
- data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +58 -0
- data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +1 -9
- data/ext/ice/cpp/include/IceUtil/ScopedArray.h +8 -2
- data/ext/ice/cpp/include/IceUtil/Shared.h +5 -7
- data/ext/ice/cpp/{src → include}/IceUtil/StopWatch.h +2 -2
- data/ext/ice/cpp/include/IceUtil/StringConverter.h +77 -72
- data/ext/ice/cpp/include/IceUtil/StringUtil.h +32 -21
- data/ext/ice/cpp/include/IceUtil/Thread.h +10 -12
- data/ext/ice/cpp/include/IceUtil/ThreadException.h +33 -42
- data/ext/ice/cpp/include/IceUtil/Time.h +3 -3
- data/ext/ice/cpp/include/IceUtil/Timer.h +14 -13
- data/ext/ice/cpp/include/IceUtil/UUID.h +2 -2
- data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +1 -1
- data/ext/ice/cpp/include/{Ice → generated/Ice}/BuiltinSequences.h +41 -8
- data/ext/ice/cpp/include/generated/Ice/Communicator.h +364 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/CommunicatorF.h +40 -8
- data/ext/ice/cpp/include/generated/Ice/Connection.h +872 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ConnectionF.h +46 -8
- data/ext/ice/cpp/include/{Ice → generated/Ice}/Current.h +71 -8
- data/ext/ice/cpp/include/generated/Ice/Endpoint.h +582 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/EndpointF.h +62 -8
- data/ext/ice/cpp/include/{Ice → generated/Ice}/EndpointTypes.h +31 -16
- data/ext/ice/cpp/include/{Ice → generated/Ice}/FacetMap.h +23 -8
- data/ext/ice/cpp/include/generated/Ice/Identity.h +221 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ImplicitContext.h +72 -13
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ImplicitContextF.h +40 -8
- data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +602 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/InstrumentationF.h +54 -8
- data/ext/ice/cpp/include/generated/Ice/LocalException.h +2802 -0
- data/ext/ice/cpp/include/generated/Ice/Locator.h +2036 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/LocatorF.h +53 -12
- data/ext/ice/cpp/include/{Ice → generated/Ice}/Logger.h +71 -13
- data/ext/ice/cpp/include/{Ice → generated/Ice}/LoggerF.h +40 -8
- data/ext/ice/cpp/include/generated/Ice/Metrics.h +2649 -0
- data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +302 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ObjectAdapterF.h +40 -8
- data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +142 -0
- data/ext/ice/cpp/include/generated/Ice/Plugin.h +197 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/PluginF.h +43 -8
- data/ext/ice/cpp/include/generated/Ice/Process.h +536 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ProcessF.h +45 -10
- data/ext/ice/cpp/include/{Ice → generated/Ice}/Properties.h +88 -21
- data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +749 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/PropertiesF.h +48 -10
- data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +1449 -0
- data/ext/ice/cpp/include/generated/Ice/Router.h +1032 -0
- data/ext/ice/cpp/include/{Ice → generated/Ice}/RouterF.h +45 -10
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ServantLocator.h +65 -13
- data/ext/ice/cpp/include/{Ice → generated/Ice}/ServantLocatorF.h +40 -8
- data/ext/ice/cpp/include/{Ice → generated/Ice}/SliceChecksumDict.h +23 -8
- data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +169 -0
- data/ext/ice/cpp/include/generated/Ice/Version.h +334 -0
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +172 -0
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +98 -0
- data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +156 -0
- data/ext/ice/cpp/src/Ice/ACM.cpp +18 -14
- data/ext/ice/cpp/src/Ice/ACM.h +9 -2
- data/ext/ice/cpp/{include → src}/Ice/ACMF.h +10 -5
- data/ext/ice/cpp/src/Ice/Acceptor.cpp +6 -1
- data/ext/ice/cpp/src/Ice/Acceptor.h +4 -3
- data/ext/ice/cpp/src/Ice/AcceptorF.h +1 -1
- data/ext/ice/cpp/src/{IceUtil → Ice}/ArgVector.cpp +9 -9
- data/ext/ice/cpp/src/{IceUtil → Ice}/ArgVector.h +7 -7
- data/ext/ice/cpp/src/Ice/AsyncResult.cpp +15 -538
- data/ext/ice/cpp/src/Ice/Base64.cpp +11 -11
- data/ext/ice/cpp/src/Ice/Base64.h +1 -1
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +40 -12
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +15 -10
- data/ext/ice/cpp/src/Ice/Buffer.cpp +74 -12
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +20 -6
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +85 -190
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +17 -18
- data/ext/ice/cpp/src/Ice/Communicator.cpp +39 -8
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +271 -104
- data/ext/ice/cpp/src/Ice/CommunicatorI.h +84 -28
- data/ext/ice/cpp/src/{IceUtil → Ice}/Cond.cpp +3 -3
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +58 -125
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +11 -22
- data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +6 -2
- data/ext/ice/cpp/src/Ice/Connection.cpp +88 -8
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +158 -80
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +41 -23
- data/ext/ice/cpp/{include → src}/Ice/ConnectionFactoryF.h +8 -3
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +707 -653
- data/ext/ice/cpp/src/Ice/ConnectionI.h +97 -69
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +2 -15
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +4 -3
- data/ext/ice/cpp/src/Ice/Connector.cpp +6 -1
- data/ext/ice/cpp/src/Ice/Connector.h +4 -3
- data/ext/ice/cpp/src/Ice/ConnectorF.h +1 -1
- data/ext/ice/cpp/src/{IceUtil → Ice}/CountDownLatch.cpp +4 -4
- data/ext/ice/cpp/src/Ice/Current.cpp +29 -6
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +6 -5
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +1 -1
- data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +1 -1
- data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +5 -25
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +29 -19
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +85 -6
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +152 -1
- data/ext/ice/cpp/src/Ice/EndpointFactory.h +72 -6
- data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +35 -19
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +10 -4
- data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +1 -1
- data/ext/ice/cpp/src/Ice/EndpointI.cpp +17 -1
- data/ext/ice/cpp/src/Ice/EndpointI.h +35 -9
- data/ext/ice/cpp/src/Ice/EndpointIF.h +18 -5
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +18 -6
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +6 -4
- data/ext/ice/cpp/src/Ice/EventHandler.h +13 -8
- data/ext/ice/cpp/src/Ice/EventHandlerF.h +5 -2
- data/ext/ice/cpp/src/Ice/Exception.cpp +95 -86
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +20 -6
- data/ext/ice/cpp/src/Ice/FactoryTable.cpp +37 -28
- data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +2 -4
- data/ext/ice/cpp/src/Ice/GCObject.cpp +28 -25
- data/ext/ice/cpp/src/Ice/HashUtil.h +2 -3
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +1 -2
- data/ext/ice/cpp/src/Ice/HttpParser.h +1 -1
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +92 -53
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +19 -10
- data/ext/ice/cpp/src/Ice/IPEndpointIF.h +6 -2
- data/ext/ice/cpp/src/Ice/IconvStringConverter.cpp +56 -0
- data/ext/ice/cpp/src/Ice/Identity.cpp +24 -10
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +37 -6
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +14 -14
- data/ext/ice/cpp/src/Ice/ImplicitContextI.h +7 -5
- data/ext/ice/cpp/src/Ice/Incoming.cpp +276 -245
- data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +104 -209
- data/ext/ice/cpp/src/Ice/IncomingRequest.h +5 -4
- data/ext/ice/cpp/src/Ice/Initialize.cpp +299 -172
- data/ext/ice/cpp/src/Ice/InputStream.cpp +2773 -0
- data/ext/ice/cpp/src/Ice/Instance.cpp +191 -231
- data/ext/ice/cpp/src/Ice/Instance.h +30 -18
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +106 -7
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +117 -99
- data/ext/ice/cpp/src/Ice/InstrumentationI.h +30 -31
- data/ext/ice/cpp/src/Ice/LocalException.cpp +1190 -416
- data/ext/ice/cpp/src/Ice/LocalObject.cpp +1 -2
- data/ext/ice/cpp/src/Ice/Locator.cpp +1167 -1215
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +29 -6
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +129 -163
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +29 -29
- data/ext/ice/cpp/src/Ice/LocatorInfoF.h +1 -1
- data/ext/ice/cpp/src/Ice/Logger.cpp +35 -5
- data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +178 -73
- data/ext/ice/cpp/src/Ice/LoggerAdminI.h +4 -4
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +14 -44
- data/ext/ice/cpp/src/Ice/LoggerI.h +7 -13
- data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +10 -12
- data/ext/ice/cpp/src/Ice/Metrics.cpp +1059 -1069
- data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +49 -19
- data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +1 -2
- data/ext/ice/cpp/src/Ice/Network.cpp +534 -170
- data/ext/ice/cpp/src/Ice/Network.h +100 -23
- data/ext/ice/cpp/src/Ice/NetworkF.h +2 -2
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +21 -14
- data/ext/ice/cpp/src/Ice/NetworkProxy.h +5 -2
- data/ext/ice/cpp/src/Ice/NetworkProxyF.h +1 -1
- data/ext/ice/cpp/src/Ice/Object.cpp +217 -221
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +41 -6
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +35 -14
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +13 -7
- data/ext/ice/cpp/{include → src}/Ice/ObjectAdapterFactoryF.h +5 -1
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +184 -58
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +32 -26
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +37 -6
- data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +9 -32
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +40 -18
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +14 -5
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +803 -365
- data/ext/ice/cpp/src/Ice/OutputStream.cpp +1399 -0
- data/ext/ice/cpp/src/Ice/Plugin.cpp +45 -6
- data/ext/ice/cpp/src/Ice/PluginF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +13 -13
- data/ext/ice/cpp/src/Ice/PluginManagerI.h +5 -6
- data/ext/ice/cpp/src/Ice/Process.cpp +256 -114
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +29 -6
- data/ext/ice/cpp/src/Ice/Properties.cpp +38 -8
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +340 -328
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +81 -17
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +29 -5
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +29 -6
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +25 -26
- data/ext/ice/cpp/src/Ice/PropertiesI.h +8 -11
- data/ext/ice/cpp/src/Ice/PropertyNames.cpp +107 -50
- data/ext/ice/cpp/src/Ice/PropertyNames.h +4 -2
- data/ext/ice/cpp/src/Ice/Protocol.cpp +2 -2
- data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +37 -2
- data/ext/ice/cpp/src/Ice/ProtocolInstance.h +9 -20
- data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +1 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +6 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +3 -1
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +1 -1
- data/ext/ice/cpp/src/Ice/Proxy.cpp +690 -964
- data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +23 -32
- data/ext/ice/cpp/src/Ice/ProxyFactory.h +16 -11
- data/ext/ice/cpp/src/Ice/Reference.cpp +75 -69
- data/ext/ice/cpp/src/Ice/Reference.h +27 -22
- data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +18 -21
- data/ext/ice/cpp/src/Ice/ReferenceFactory.h +12 -12
- data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +1 -1
- data/ext/ice/cpp/src/Ice/RegisterPluginsInit.cpp +18 -4
- data/ext/ice/cpp/src/Ice/RegisterPluginsInit.h +1 -1
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +672 -552
- data/ext/ice/cpp/src/Ice/ReplyStatus.h +1 -1
- data/ext/ice/cpp/src/Ice/RequestHandler.cpp +5 -3
- data/ext/ice/cpp/src/Ice/RequestHandler.h +10 -13
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +10 -6
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +2 -2
- data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +3 -6
- data/ext/ice/cpp/src/Ice/ResponseHandler.h +16 -7
- data/ext/ice/cpp/src/Ice/RetryQueue.cpp +6 -12
- data/ext/ice/cpp/src/Ice/RetryQueue.h +7 -6
- data/ext/ice/cpp/src/Ice/RetryQueueF.h +1 -1
- data/ext/ice/cpp/src/Ice/Router.cpp +523 -474
- data/ext/ice/cpp/src/Ice/RouterF.cpp +29 -6
- data/ext/ice/cpp/src/Ice/RouterInfo.cpp +91 -70
- data/ext/ice/cpp/src/Ice/RouterInfo.h +43 -32
- data/ext/ice/cpp/src/Ice/RouterInfoF.h +1 -1
- data/ext/ice/cpp/src/{IceUtil → Ice}/SHA1.cpp +21 -21
- data/ext/ice/cpp/src/Ice/Selector.cpp +989 -923
- data/ext/ice/cpp/src/Ice/Selector.h +100 -147
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +37 -6
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +27 -5
- data/ext/ice/cpp/src/Ice/ServantManager.cpp +9 -9
- data/ext/ice/cpp/src/Ice/ServantManager.h +1 -1
- data/ext/ice/cpp/src/Ice/SharedContext.h +2 -2
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +20 -6
- data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +2 -2
- data/ext/ice/cpp/src/Ice/SlicedData.cpp +72 -20
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +173 -18
- data/ext/ice/cpp/src/Ice/StreamSocket.h +13 -4
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +48 -17
- data/ext/ice/cpp/src/Ice/StringUtil.h +35 -0
- data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +8 -4
- data/ext/ice/cpp/src/Ice/SysLoggerI.h +2 -3
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +158 -32
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +12 -5
- data/ext/ice/cpp/src/Ice/TcpConnector.cpp +1 -7
- data/ext/ice/cpp/src/Ice/TcpConnector.h +1 -2
- data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +40 -32
- data/ext/ice/cpp/src/Ice/TcpEndpointI.h +11 -8
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +12 -27
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +7 -10
- data/ext/ice/cpp/src/{IceUtil → Ice}/Thread.cpp +24 -41
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +175 -267
- data/ext/ice/cpp/src/Ice/ThreadPool.h +38 -43
- data/ext/ice/cpp/src/{IceUtil → Ice}/Timer.cpp +28 -21
- data/ext/ice/cpp/src/Ice/TraceLevels.cpp +2 -2
- data/ext/ice/cpp/src/Ice/TraceLevels.h +1 -1
- data/ext/ice/cpp/src/Ice/TraceLevelsF.h +2 -2
- data/ext/ice/cpp/src/Ice/TraceUtil.cpp +53 -31
- data/ext/ice/cpp/src/Ice/TraceUtil.h +13 -6
- data/ext/ice/cpp/src/Ice/Transceiver.cpp +1 -2
- data/ext/ice/cpp/src/Ice/Transceiver.h +8 -7
- data/ext/ice/cpp/src/Ice/TransceiverF.h +1 -1
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +2 -8
- data/ext/ice/cpp/src/Ice/UdpConnector.h +1 -2
- data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +92 -31
- data/ext/ice/cpp/src/Ice/UdpEndpointI.h +12 -4
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +150 -179
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +15 -17
- data/ext/ice/cpp/src/Ice/Value.cpp +81 -0
- data/ext/ice/cpp/src/Ice/ValueFactory.cpp +84 -0
- data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +70 -0
- data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.h +42 -0
- data/ext/ice/cpp/src/Ice/Version.cpp +24 -14
- data/ext/ice/cpp/src/Ice/VirtualShared.h +43 -0
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +3 -9
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +3 -7
- data/ext/ice/cpp/src/Ice/WSConnector.cpp +5 -11
- data/ext/ice/cpp/src/Ice/WSConnector.h +3 -6
- data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +185 -80
- data/ext/ice/cpp/src/Ice/WSEndpoint.h +21 -31
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +41 -37
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +7 -21
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +526 -264
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +341 -455
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +86 -26
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +59 -23
- data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +315 -61
- data/ext/ice/cpp/src/IceDiscovery/LookupI.h +83 -36
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +57 -59
- data/ext/ice/cpp/src/IceDiscovery/PluginI.h +3 -3
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +396 -159
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +251 -355
- data/ext/ice/cpp/src/IceLocatorDiscovery/Plugin.h +52 -0
- data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +526 -131
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +19 -165
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +8 -17
- data/ext/ice/cpp/src/IceSSL/CertificateI.cpp +284 -0
- data/ext/ice/cpp/src/IceSSL/CertificateI.h +69 -0
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +39 -11
- data/ext/ice/cpp/src/{Ice/ObjectFactoryF.cpp → IceSSL/ConnectionInfoF.cpp} +31 -9
- data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +14 -56
- data/ext/ice/cpp/src/IceSSL/ConnectorI.h +6 -13
- data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +205 -197
- data/ext/ice/cpp/src/IceSSL/EndpointI.h +41 -33
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +39 -10
- data/ext/ice/cpp/src/IceSSL/Instance.cpp +1 -6
- data/ext/ice/cpp/src/IceSSL/Instance.h +7 -7
- data/ext/ice/cpp/src/IceSSL/InstanceF.h +11 -7
- data/ext/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +588 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +117 -152
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.h +64 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngineF.h +32 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +132 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +400 -89
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +36 -21
- data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +291 -0
- data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.h +63 -0
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +71 -41
- data/ext/ice/cpp/src/IceSSL/PluginI.h +13 -18
- data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +9 -54
- data/ext/ice/cpp/src/IceSSL/RFC2253.h +7 -7
- data/ext/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +585 -0
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +491 -75
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.h +126 -0
- data/ext/ice/cpp/src/IceSSL/SChannelEngineF.h +32 -0
- data/ext/ice/cpp/src/IceSSL/SChannelPluginI.cpp +78 -0
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +126 -169
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +19 -22
- data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +79 -74
- data/ext/ice/cpp/src/IceSSL/SSLEngine.h +24 -187
- data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +4 -19
- data/ext/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +862 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +56 -214
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.h +60 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngineF.h +31 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +80 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +137 -144
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +25 -28
- data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +857 -0
- data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.h +46 -0
- data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +9 -13
- data/ext/ice/cpp/src/IceSSL/TrustManager.h +4 -4
- data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +3 -3
- data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +271 -0
- data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +343 -0
- data/ext/ice/cpp/src/IceSSL/UWPEngine.h +46 -0
- data/ext/ice/cpp/{include/Ice/ObjectFactoryManagerF.h → src/IceSSL/UWPEngineF.h} +13 -8
- data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +94 -0
- data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +388 -0
- data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +76 -0
- data/ext/ice/cpp/src/IceSSL/Util.cpp +66 -1256
- data/ext/ice/cpp/src/IceSSL/Util.h +48 -137
- data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +162 -0
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +22 -22
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +34 -26
- data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +20 -31
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +25 -116
- data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/Options.cpp +23 -46
- data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +7 -6
- data/ext/ice/cpp/src/IceUtil/Random.cpp +13 -13
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +3 -9
- data/ext/ice/cpp/src/IceUtil/Shared.cpp +8 -3
- data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +501 -264
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +540 -235
- data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +37 -74
- data/ext/ice/cpp/src/IceUtil/Time.cpp +1 -1
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +10 -10
- data/ext/ice/cpp/src/IceUtil/Unicode.cpp +98 -97
- data/ext/ice/cpp/src/IceUtil/Unicode.h +21 -35
- data/ext/ice/cpp/src/IceUtil/UtilException.cpp +838 -0
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +815 -163
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.h +76 -0
- data/ext/ice/cpp/src/Slice/Checksum.cpp +2 -2
- data/ext/ice/cpp/{include → src}/Slice/Checksum.h +2 -2
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +25 -78
- data/ext/ice/cpp/{include → src}/Slice/FileTracker.h +9 -9
- data/ext/ice/cpp/src/Slice/Grammar.cpp +1994 -1943
- data/ext/ice/cpp/src/Slice/Grammar.h +44 -24
- data/ext/ice/cpp/src/Slice/GrammarUtil.h +14 -14
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +2658 -1927
- data/ext/ice/cpp/{include → src}/Slice/JavaUtil.h +178 -59
- data/ext/ice/cpp/src/Slice/MD5.cpp +1 -1
- data/ext/ice/cpp/src/Slice/MD5.h +1 -1
- data/ext/ice/cpp/src/Slice/MD5I.cpp +0 -1
- data/ext/ice/cpp/src/Slice/MD5I.h +1 -1
- data/ext/ice/cpp/src/Slice/PHPUtil.cpp +12 -15
- data/ext/ice/cpp/{include → src}/Slice/PHPUtil.h +6 -15
- data/ext/ice/cpp/src/Slice/Parser.cpp +802 -307
- data/ext/ice/cpp/{include → src}/Slice/Parser.h +76 -84
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +43 -21
- data/ext/ice/cpp/{include → src}/Slice/Preprocessor.h +7 -12
- data/ext/ice/cpp/src/Slice/Python.cpp +207 -86
- data/ext/ice/cpp/src/Slice/PythonUtil.cpp +683 -679
- data/ext/ice/cpp/{include → src}/Slice/PythonUtil.h +19 -8
- data/ext/ice/cpp/src/Slice/Ruby.cpp +38 -34
- data/ext/ice/cpp/src/Slice/RubyUtil.cpp +177 -445
- data/ext/ice/cpp/{include → src}/Slice/RubyUtil.h +6 -6
- data/ext/ice/cpp/src/Slice/Scanner.cpp +218 -306
- data/ext/ice/cpp/src/Slice/{Util.cpp → SliceUtil.cpp} +37 -64
- data/ext/ice/cpp/src/Slice/StringLiteralUtil.cpp +374 -0
- data/ext/ice/cpp/src/Slice/Util.h +54 -0
- data/ext/ice/mcpp/Makefile +5 -2
- data/ice.gemspec +2 -7
- data/lib/Glacier2.rb +1 -1
- data/lib/Glacier2/Metrics.rb +7 -46
- data/lib/Glacier2/PermissionsVerifier.rb +24 -95
- data/lib/Glacier2/PermissionsVerifierF.rb +3 -3
- data/lib/Glacier2/Router.rb +32 -74
- data/lib/Glacier2/RouterF.rb +3 -3
- data/lib/Glacier2/SSLInfo.rb +4 -7
- data/lib/Glacier2/Session.rb +88 -307
- data/lib/Ice.rb +83 -52
- data/lib/Ice/BuiltinSequences.rb +4 -4
- data/lib/Ice/Communicator.rb +56 -58
- data/lib/Ice/CommunicatorF.rb +3 -3
- data/lib/Ice/Connection.rb +153 -162
- data/lib/Ice/ConnectionF.rb +3 -3
- data/lib/Ice/Current.rb +4 -11
- data/lib/Ice/Endpoint.rb +57 -133
- data/lib/Ice/EndpointF.rb +3 -3
- data/lib/Ice/EndpointTypes.rb +3 -7
- data/lib/Ice/FacetMap.rb +4 -4
- data/lib/Ice/Identity.rb +5 -8
- data/lib/Ice/ImplicitContext.rb +5 -34
- data/lib/Ice/ImplicitContextF.rb +3 -3
- data/lib/Ice/Instrumentation.rb +23 -275
- data/lib/Ice/InstrumentationF.rb +3 -3
- data/lib/Ice/LocalException.rb +95 -141
- data/lib/Ice/Locator.rb +51 -165
- data/lib/Ice/LocatorF.rb +3 -3
- data/lib/Ice/Logger.rb +5 -34
- data/lib/Ice/LoggerF.rb +3 -3
- data/lib/Ice/Metrics.rb +61 -416
- data/lib/Ice/ObjectAdapter.rb +34 -0
- data/lib/Ice/ObjectAdapterF.rb +3 -3
- data/lib/Ice/ObjectFactory.rb +5 -30
- data/lib/Ice/Plugin.rb +7 -60
- data/lib/Ice/PluginF.rb +3 -3
- data/lib/Ice/Process.rb +16 -52
- data/lib/Ice/ProcessF.rb +3 -3
- data/lib/Ice/Properties.rb +5 -41
- data/lib/Ice/PropertiesAdmin.rb +19 -56
- data/lib/Ice/PropertiesF.rb +3 -3
- data/lib/Ice/RemoteLogger.rb +34 -115
- data/lib/Ice/Router.rb +29 -101
- data/lib/Ice/RouterF.rb +3 -3
- data/lib/Ice/ServantLocator.rb +31 -0
- data/lib/Ice/{ObjectFactoryF.rb → ServantLocatorF.rb} +6 -6
- data/lib/Ice/SliceChecksumDict.rb +3 -3
- data/lib/Ice/ValueFactory.rb +33 -0
- data/lib/Ice/Version.rb +5 -11
- data/lib/IceBox.rb +1 -1
- data/lib/IceBox/IceBox.rb +44 -148
- data/lib/IceGrid.rb +1 -4
- data/lib/IceGrid/Admin.rb +551 -427
- data/lib/IceGrid/Descriptor.rb +62 -529
- data/lib/IceGrid/Exception.rb +24 -45
- data/lib/IceGrid/FileParser.rb +14 -50
- data/lib/IceGrid/PluginFacade.rb +40 -0
- data/lib/IceGrid/Registry.rb +151 -58
- data/lib/IceGrid/Session.rb +25 -64
- data/lib/IceGrid/UserAccountMapper.rb +14 -50
- data/lib/IcePatch2.rb +1 -1
- data/lib/IcePatch2/FileInfo.rb +5 -11
- data/lib/IcePatch2/FileServer.rb +33 -76
- data/lib/IceStorm.rb +1 -1
- data/lib/IceStorm/IceStorm.rb +79 -206
- data/lib/IceStorm/Metrics.rb +11 -89
- data/slice/Glacier2/Metrics.ice +8 -4
- data/slice/Glacier2/PermissionsVerifier.ice +10 -7
- data/slice/Glacier2/PermissionsVerifierF.ice +7 -4
- data/slice/Glacier2/Router.ice +10 -8
- data/slice/Glacier2/RouterF.ice +7 -4
- data/slice/Glacier2/SSLInfo.ice +8 -5
- data/slice/Glacier2/Session.ice +15 -13
- data/slice/Ice/BuiltinSequences.ice +7 -4
- data/slice/Ice/Communicator.ice +141 -66
- data/slice/Ice/CommunicatorF.ice +7 -4
- data/slice/Ice/Connection.ice +183 -86
- data/slice/Ice/ConnectionF.ice +7 -4
- data/slice/Ice/Current.ice +13 -9
- data/slice/Ice/Endpoint.ice +63 -14
- data/slice/Ice/EndpointF.ice +7 -4
- data/slice/Ice/EndpointTypes.ice +8 -6
- data/slice/Ice/FacetMap.ice +7 -4
- data/slice/Ice/Identity.ice +13 -5
- data/slice/Ice/ImplicitContext.ice +20 -18
- data/slice/Ice/ImplicitContextF.ice +7 -4
- data/slice/Ice/Instrumentation.ice +20 -19
- data/slice/Ice/InstrumentationF.ice +8 -5
- data/slice/Ice/LocalException.ice +87 -87
- data/slice/Ice/Locator.ice +19 -18
- data/slice/Ice/LocatorF.ice +7 -4
- data/slice/Ice/Logger.ice +9 -7
- data/slice/Ice/LoggerF.ice +7 -4
- data/slice/Ice/Metrics.ice +18 -14
- data/slice/Ice/ObjectAdapter.ice +30 -13
- data/slice/Ice/ObjectAdapterF.ice +7 -4
- data/slice/Ice/ObjectFactory.ice +15 -12
- data/slice/Ice/Plugin.ice +9 -6
- data/slice/Ice/PluginF.ice +8 -5
- data/slice/Ice/Process.ice +9 -6
- data/slice/Ice/ProcessF.ice +7 -4
- data/slice/Ice/Properties.ice +15 -12
- data/slice/Ice/PropertiesAdmin.ice +9 -5
- data/slice/Ice/PropertiesF.ice +7 -4
- data/slice/Ice/RemoteLogger.ice +33 -24
- data/slice/Ice/Router.ice +16 -7
- data/slice/Ice/RouterF.ice +7 -4
- data/slice/Ice/ServantLocator.ice +13 -10
- data/slice/Ice/ServantLocatorF.ice +7 -4
- data/slice/Ice/SliceChecksumDict.ice +7 -4
- data/slice/Ice/ValueFactory.ice +127 -0
- data/slice/Ice/Version.ice +9 -5
- data/slice/IceBT/ConnectionInfo.ice +53 -0
- data/slice/IceBT/EndpointInfo.ice +51 -0
- data/slice/IceBT/Types.ice +39 -0
- data/slice/IceBox/IceBox.ice +20 -21
- data/slice/IceDiscovery/IceDiscovery.ice +9 -5
- data/slice/IceGrid/Admin.ice +390 -30
- data/slice/IceGrid/Descriptor.ice +37 -29
- data/slice/IceGrid/Exception.ice +33 -27
- data/slice/IceGrid/FileParser.ice +9 -6
- data/slice/IceGrid/PluginFacade.ice +11 -9
- data/slice/IceGrid/Registry.ice +139 -16
- data/slice/IceGrid/Session.ice +10 -8
- data/slice/IceGrid/UserAccountMapper.ice +9 -6
- data/slice/IceIAP/ConnectionInfo.ice +70 -0
- data/slice/IceIAP/EndpointInfo.ice +64 -0
- data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +9 -7
- data/slice/IcePatch2/FileInfo.ice +9 -8
- data/slice/IcePatch2/FileServer.ice +17 -13
- data/slice/IceSSL/ConnectionInfo.ice +14 -17
- data/slice/IceSSL/ConnectionInfoF.ice +24 -0
- data/slice/IceSSL/EndpointInfo.ice +9 -30
- data/slice/IceStorm/IceStorm.ice +22 -18
- data/slice/IceStorm/Metrics.ice +9 -5
- metadata +154 -120
- data/ext/ObjectFactory.cpp +0 -140
- data/ext/ObjectFactory.h +0 -50
- data/ext/ice/cpp/include/Ice/BasicStream.h +0 -1335
- data/ext/ice/cpp/include/Ice/Communicator.h +0 -200
- data/ext/ice/cpp/include/Ice/Connection.h +0 -497
- data/ext/ice/cpp/include/Ice/DeprecatedStringConverter.h +0 -62
- data/ext/ice/cpp/include/Ice/Endpoint.h +0 -341
- data/ext/ice/cpp/include/Ice/Identity.h +0 -168
- data/ext/ice/cpp/include/Ice/Instrumentation.h +0 -365
- data/ext/ice/cpp/include/Ice/LocalException.h +0 -1030
- data/ext/ice/cpp/include/Ice/Locator.h +0 -2193
- data/ext/ice/cpp/include/Ice/Metrics.h +0 -2974
- data/ext/ice/cpp/include/Ice/ObjectAdapter.h +0 -168
- data/ext/ice/cpp/include/Ice/ObjectFactory.h +0 -92
- data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +0 -66
- data/ext/ice/cpp/include/Ice/Outgoing.h +0 -225
- data/ext/ice/cpp/include/Ice/Plugin.h +0 -125
- data/ext/ice/cpp/include/Ice/Process.h +0 -574
- data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +0 -830
- data/ext/ice/cpp/include/Ice/RemoteLogger.h +0 -1500
- data/ext/ice/cpp/include/Ice/Router.h +0 -1159
- data/ext/ice/cpp/include/Ice/Stream.h +0 -447
- data/ext/ice/cpp/include/Ice/StreamF.h +0 -30
- data/ext/ice/cpp/include/Ice/Version.h +0 -262
- data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +0 -158
- data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +0 -142
- data/ext/ice/cpp/include/IceUtil/AbstractMutex.h +0 -119
- data/ext/ice/cpp/include/IceUtil/Cache.h +0 -362
- data/ext/ice/cpp/include/Slice/CPlusPlusUtil.h +0 -65
- data/ext/ice/cpp/include/Slice/CsUtil.h +0 -92
- data/ext/ice/cpp/include/Slice/DotNetNames.h +0 -34
- data/ext/ice/cpp/include/Slice/ObjCUtil.h +0 -127
- data/ext/ice/cpp/include/Slice/Util.h +0 -56
- data/ext/ice/cpp/src/Ice/BasicStream.cpp +0 -3428
- data/ext/ice/cpp/src/Ice/DeprecatedStringConverter.cpp +0 -62
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.cpp +0 -139
- data/ext/ice/cpp/src/Ice/ObjectFactoryManager.h +0 -43
- data/ext/ice/cpp/src/Ice/Outgoing.cpp +0 -694
- data/ext/ice/cpp/src/Ice/Stream.cpp +0 -53
- data/ext/ice/cpp/src/Ice/StreamI.cpp +0 -832
- data/ext/ice/cpp/src/Ice/StreamI.h +0 -198
- data/ext/ice/cpp/src/IceSSL/Certificate.cpp +0 -1336
- data/ext/ice/cpp/src/IceUtil/Exception.cpp +0 -792
- data/ext/ice/cpp/src/IceUtil/FileUtil.h +0 -185
- data/ext/ice/cpp/src/Slice/CsUtil.cpp +0 -2660
- data/ext/ice/cpp/src/Slice/DotNetNames.cpp +0 -146
- data/ext/ice/cpp/src/Slice/ObjCUtil.cpp +0 -1310
- data/lib/IceGrid/Locator.rb +0 -106
- data/lib/IceGrid/Observer.rb +0 -572
- data/lib/IceGrid/Query.rb +0 -169
- data/slice/Freeze/BackgroundSaveEvictor.ice +0 -111
- data/slice/Freeze/CatalogData.ice +0 -49
- data/slice/Freeze/Connection.ice +0 -121
- data/slice/Freeze/DB.ice +0 -37
- data/slice/Freeze/Evictor.ice +0 -346
- data/slice/Freeze/EvictorF.ice +0 -22
- data/slice/Freeze/EvictorStorage.ice +0 -72
- data/slice/Freeze/Exception.ice +0 -100
- data/slice/Freeze/Transaction.ice +0 -58
- data/slice/Freeze/TransactionalEvictor.ice +0 -50
- data/slice/IceGrid/Locator.ice +0 -57
- data/slice/IceGrid/Observer.ice +0 -395
- data/slice/IceGrid/Query.ice +0 -131
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// **********************************************************************
|
|
2
2
|
//
|
|
3
|
-
// Copyright (c) 2003-
|
|
3
|
+
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
|
|
4
4
|
//
|
|
5
5
|
// This copy of Ice is licensed to you under the terms described in the
|
|
6
6
|
// ICE_LICENSE file included in this distribution.
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
#include <Ice/EndpointI.h>
|
|
28
28
|
#include <Ice/InstrumentationF.h>
|
|
29
29
|
#include <Ice/ACMF.h>
|
|
30
|
+
#include <Ice/Comparable.h>
|
|
30
31
|
|
|
31
32
|
#include <list>
|
|
32
33
|
#include <set>
|
|
@@ -36,18 +37,18 @@ namespace Ice
|
|
|
36
37
|
|
|
37
38
|
class LocalException;
|
|
38
39
|
class ObjectAdapterI;
|
|
39
|
-
|
|
40
|
+
ICE_DEFINE_PTR(ObjectAdapterIPtr, ObjectAdapterI);
|
|
40
41
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
namespace IceInternal
|
|
44
45
|
{
|
|
45
46
|
|
|
46
|
-
class OutgoingConnectionFactory : virtual
|
|
47
|
+
class OutgoingConnectionFactory : public virtual IceUtil::Shared, public IceUtil::Monitor<IceUtil::Mutex>
|
|
47
48
|
{
|
|
48
49
|
public:
|
|
49
50
|
|
|
50
|
-
class CreateConnectionCallback : virtual
|
|
51
|
+
class CreateConnectionCallback : public virtual IceUtil::Shared
|
|
51
52
|
{
|
|
52
53
|
public:
|
|
53
54
|
|
|
@@ -62,18 +63,17 @@ public:
|
|
|
62
63
|
|
|
63
64
|
void waitUntilFinished();
|
|
64
65
|
|
|
65
|
-
void create(const std::vector<EndpointIPtr>&, bool, Ice::EndpointSelectionType,
|
|
66
|
-
const CreateConnectionCallbackPtr&);
|
|
66
|
+
void create(const std::vector<EndpointIPtr>&, bool, Ice::EndpointSelectionType, const CreateConnectionCallbackPtr&);
|
|
67
67
|
void setRouterInfo(const RouterInfoPtr&);
|
|
68
68
|
void removeAdapter(const Ice::ObjectAdapterPtr&);
|
|
69
|
-
void flushAsyncBatchRequests(const CommunicatorFlushBatchAsyncPtr
|
|
70
|
-
|
|
71
|
-
private:
|
|
69
|
+
void flushAsyncBatchRequests(const CommunicatorFlushBatchAsyncPtr&, Ice::CompressBatch);
|
|
72
70
|
|
|
73
71
|
OutgoingConnectionFactory(const Ice::CommunicatorPtr&, const InstancePtr&);
|
|
74
72
|
virtual ~OutgoingConnectionFactory();
|
|
75
73
|
friend class Instance;
|
|
76
74
|
|
|
75
|
+
private:
|
|
76
|
+
|
|
77
77
|
struct ConnectorInfo
|
|
78
78
|
{
|
|
79
79
|
ConnectorInfo(const ConnectorPtr& c, const EndpointIPtr& e) : connector(c), endpoint(e)
|
|
@@ -86,7 +86,12 @@ private:
|
|
|
86
86
|
EndpointIPtr endpoint;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
class ConnectCallback : public Ice::ConnectionI::StartCallback,
|
|
89
|
+
class ConnectCallback : public Ice::ConnectionI::StartCallback,
|
|
90
|
+
public IceInternal::EndpointI_connectors
|
|
91
|
+
#ifdef ICE_CPP11_MAPPING
|
|
92
|
+
, public std::enable_shared_from_this<ConnectCallback>
|
|
93
|
+
#endif
|
|
94
|
+
|
|
90
95
|
{
|
|
91
96
|
public:
|
|
92
97
|
|
|
@@ -129,7 +134,7 @@ private:
|
|
|
129
134
|
std::vector<ConnectorInfo> _connectors;
|
|
130
135
|
std::vector<ConnectorInfo>::const_iterator _iter;
|
|
131
136
|
};
|
|
132
|
-
|
|
137
|
+
ICE_DEFINE_PTR(ConnectCallbackPtr, ConnectCallback);
|
|
133
138
|
friend class ConnectCallback;
|
|
134
139
|
|
|
135
140
|
std::vector<EndpointIPtr> applyOverrides(const std::vector<EndpointIPtr>&);
|
|
@@ -158,7 +163,11 @@ private:
|
|
|
158
163
|
std::multimap<ConnectorPtr, Ice::ConnectionIPtr> _connections;
|
|
159
164
|
std::map<ConnectorPtr, std::set<ConnectCallbackPtr> > _pending;
|
|
160
165
|
|
|
166
|
+
#ifdef ICE_CPP11_MAPPING
|
|
167
|
+
std::multimap<EndpointIPtr, Ice::ConnectionIPtr, Ice::TargetCompare<EndpointIPtr, std::less>> _connectionsByEndpoint;
|
|
168
|
+
#else
|
|
161
169
|
std::multimap<EndpointIPtr, Ice::ConnectionIPtr> _connectionsByEndpoint;
|
|
170
|
+
#endif
|
|
162
171
|
int _pendingConnectCount;
|
|
163
172
|
};
|
|
164
173
|
|
|
@@ -172,25 +181,24 @@ public:
|
|
|
172
181
|
void hold();
|
|
173
182
|
void destroy();
|
|
174
183
|
|
|
175
|
-
#if TARGET_OS_IPHONE != 0
|
|
176
184
|
void startAcceptor();
|
|
177
185
|
void stopAcceptor();
|
|
178
|
-
#endif
|
|
179
186
|
|
|
180
187
|
void updateConnectionObservers();
|
|
181
188
|
|
|
182
189
|
void waitUntilHolding() const;
|
|
183
190
|
void waitUntilFinished();
|
|
184
191
|
|
|
192
|
+
bool isLocal(const EndpointIPtr&) const;
|
|
185
193
|
EndpointIPtr endpoint() const;
|
|
186
194
|
std::list<Ice::ConnectionIPtr> connections() const;
|
|
187
|
-
void flushAsyncBatchRequests(const CommunicatorFlushBatchAsyncPtr
|
|
195
|
+
void flushAsyncBatchRequests(const CommunicatorFlushBatchAsyncPtr&, Ice::CompressBatch);
|
|
188
196
|
|
|
189
197
|
//
|
|
190
198
|
// Operations from EventHandler
|
|
191
199
|
//
|
|
192
200
|
|
|
193
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
201
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
194
202
|
virtual bool startAsync(SocketOperation);
|
|
195
203
|
virtual bool finishAsync(SocketOperation);
|
|
196
204
|
#endif
|
|
@@ -203,11 +211,20 @@ public:
|
|
|
203
211
|
virtual void connectionStartCompleted(const Ice::ConnectionIPtr&);
|
|
204
212
|
virtual void connectionStartFailed(const Ice::ConnectionIPtr&, const Ice::LocalException&);
|
|
205
213
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
IncomingConnectionFactory(const InstancePtr&, const EndpointIPtr&, const Ice::ObjectAdapterIPtr&);
|
|
214
|
+
IncomingConnectionFactory(const InstancePtr&, const EndpointIPtr&, const EndpointIPtr&,
|
|
215
|
+
const Ice::ObjectAdapterIPtr&);
|
|
209
216
|
void initialize();
|
|
210
217
|
virtual ~IncomingConnectionFactory();
|
|
218
|
+
|
|
219
|
+
#ifdef ICE_CPP11_MAPPING
|
|
220
|
+
std::shared_ptr<IncomingConnectionFactory> shared_from_this()
|
|
221
|
+
{
|
|
222
|
+
return std::static_pointer_cast<IncomingConnectionFactory>(EventHandler::shared_from_this());
|
|
223
|
+
}
|
|
224
|
+
#endif
|
|
225
|
+
|
|
226
|
+
private:
|
|
227
|
+
|
|
211
228
|
friend class Ice::ObjectAdapterI;
|
|
212
229
|
|
|
213
230
|
enum State
|
|
@@ -229,18 +246,19 @@ private:
|
|
|
229
246
|
AcceptorPtr _acceptor;
|
|
230
247
|
const TransceiverPtr _transceiver;
|
|
231
248
|
EndpointIPtr _endpoint;
|
|
249
|
+
EndpointIPtr _publishedEndpoint;
|
|
232
250
|
|
|
233
|
-
#if TARGET_OS_IPHONE != 0
|
|
234
251
|
bool _acceptorStarted;
|
|
235
|
-
|
|
252
|
+
bool _acceptorStopped;
|
|
236
253
|
|
|
237
254
|
Ice::ObjectAdapterIPtr _adapter;
|
|
238
|
-
|
|
239
255
|
const bool _warn;
|
|
240
|
-
|
|
241
256
|
std::set<Ice::ConnectionIPtr> _connections;
|
|
242
|
-
|
|
243
257
|
State _state;
|
|
258
|
+
|
|
259
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
260
|
+
IceInternal::UniquePtr<Ice::LocalException> _acceptorException;
|
|
261
|
+
#endif
|
|
244
262
|
};
|
|
245
263
|
|
|
246
264
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// **********************************************************************
|
|
2
2
|
//
|
|
3
|
-
// Copyright (c) 2003-
|
|
3
|
+
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
|
|
4
4
|
//
|
|
5
5
|
// This copy of Ice is licensed to you under the terms described in the
|
|
6
6
|
// ICE_LICENSE file included in this distribution.
|
|
@@ -18,12 +18,17 @@ namespace IceInternal
|
|
|
18
18
|
{
|
|
19
19
|
|
|
20
20
|
class OutgoingConnectionFactory;
|
|
21
|
-
|
|
21
|
+
IceUtil::Shared* upCast(OutgoingConnectionFactory*);
|
|
22
22
|
typedef IceInternal::Handle<OutgoingConnectionFactory> OutgoingConnectionFactoryPtr;
|
|
23
23
|
|
|
24
24
|
class IncomingConnectionFactory;
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
#ifdef ICE_CPP11_MAPPING
|
|
27
|
+
using IncomingConnectionFactoryPtr = ::std::shared_ptr<IncomingConnectionFactory>;
|
|
28
|
+
#else
|
|
29
|
+
IceUtil::Shared* upCast(IncomingConnectionFactory*);
|
|
26
30
|
typedef IceInternal::Handle<IncomingConnectionFactory> IncomingConnectionFactoryPtr;
|
|
31
|
+
#endif
|
|
27
32
|
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// **********************************************************************
|
|
2
2
|
//
|
|
3
|
-
// Copyright (c) 2003-
|
|
3
|
+
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
|
|
4
4
|
//
|
|
5
5
|
// This copy of Ice is licensed to you under the terms described in the
|
|
6
6
|
// ICE_LICENSE file included in this distribution.
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
#include <Ice/ACM.h>
|
|
21
21
|
#include <Ice/ObjectAdapterI.h> // For getThreadPool() and getServantManager().
|
|
22
22
|
#include <Ice/EndpointI.h>
|
|
23
|
-
#include <Ice/Outgoing.h>
|
|
24
23
|
#include <Ice/OutgoingAsync.h>
|
|
25
24
|
#include <Ice/Incoming.h>
|
|
26
25
|
#include <Ice/LocalException.h>
|
|
@@ -38,13 +37,14 @@ using namespace Ice;
|
|
|
38
37
|
using namespace Ice::Instrumentation;
|
|
39
38
|
using namespace IceInternal;
|
|
40
39
|
|
|
40
|
+
#ifndef ICE_CPP11_MAPPING
|
|
41
41
|
Ice::LocalObject* Ice::upCast(ConnectionI* p) { return p; }
|
|
42
|
+
#endif
|
|
42
43
|
|
|
43
44
|
namespace
|
|
44
45
|
{
|
|
45
46
|
|
|
46
|
-
const ::std::string
|
|
47
|
-
|
|
47
|
+
const ::std::string flushBatchRequests_name = "flushBatchRequests";
|
|
48
48
|
|
|
49
49
|
class TimeoutCallback : public IceUtil::TimerTask
|
|
50
50
|
{
|
|
@@ -72,8 +72,8 @@ public:
|
|
|
72
72
|
DispatchCall(const ConnectionIPtr& connection, const ConnectionI::StartCallbackPtr& startCB,
|
|
73
73
|
const vector<ConnectionI::OutgoingMessage>& sentCBs, Byte compress, Int requestId,
|
|
74
74
|
Int invokeNum, const ServantManagerPtr& servantManager, const ObjectAdapterPtr& adapter,
|
|
75
|
-
const OutgoingAsyncBasePtr& outAsync, const
|
|
76
|
-
|
|
75
|
+
const OutgoingAsyncBasePtr& outAsync, const ICE_DELEGATE(HeartbeatCallback)& heartbeatCallback,
|
|
76
|
+
InputStream& stream) :
|
|
77
77
|
DispatchWorkItem(connection),
|
|
78
78
|
_connection(connection),
|
|
79
79
|
_startCB(startCB),
|
|
@@ -108,8 +108,8 @@ private:
|
|
|
108
108
|
const ServantManagerPtr _servantManager;
|
|
109
109
|
const ObjectAdapterPtr _adapter;
|
|
110
110
|
const OutgoingAsyncBasePtr _outAsync;
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const ICE_DELEGATE(HeartbeatCallback) _heartbeatCallback;
|
|
112
|
+
InputStream _stream;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
class FinishCall : public DispatchWorkItem
|
|
@@ -133,19 +133,104 @@ private:
|
|
|
133
133
|
const bool _close;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
+
//
|
|
137
|
+
// Class for handling Ice::Connection::begin_flushBatchRequests
|
|
138
|
+
//
|
|
139
|
+
class ConnectionFlushBatchAsync : public OutgoingAsyncBase
|
|
140
|
+
{
|
|
141
|
+
public:
|
|
142
|
+
|
|
143
|
+
ConnectionFlushBatchAsync(const Ice::ConnectionIPtr&, const InstancePtr&);
|
|
144
|
+
|
|
145
|
+
virtual Ice::ConnectionPtr getConnection() const;
|
|
146
|
+
|
|
147
|
+
void invoke(const std::string&, Ice::CompressBatch);
|
|
148
|
+
|
|
149
|
+
private:
|
|
150
|
+
|
|
151
|
+
const Ice::ConnectionIPtr _connection;
|
|
152
|
+
};
|
|
153
|
+
typedef IceUtil::Handle<ConnectionFlushBatchAsync> ConnectionFlushBatchAsyncPtr;
|
|
154
|
+
|
|
136
155
|
ConnectionState connectionStateMap[] = {
|
|
137
|
-
ConnectionStateValidating, // StateNotInitialized
|
|
138
|
-
ConnectionStateValidating, // StateNotValidated
|
|
139
|
-
ConnectionStateActive, // StateActive
|
|
140
|
-
ConnectionStateHolding, // StateHolding
|
|
141
|
-
ConnectionStateClosing, // StateClosing
|
|
142
|
-
ConnectionStateClosing, // StateClosingPending
|
|
143
|
-
ConnectionStateClosed, // StateClosed
|
|
144
|
-
ConnectionStateClosed, // StateFinished
|
|
156
|
+
ICE_ENUM(ConnectionState, ConnectionStateValidating), // StateNotInitialized
|
|
157
|
+
ICE_ENUM(ConnectionState, ConnectionStateValidating), // StateNotValidated
|
|
158
|
+
ICE_ENUM(ConnectionState, ConnectionStateActive), // StateActive
|
|
159
|
+
ICE_ENUM(ConnectionState, ConnectionStateHolding), // StateHolding
|
|
160
|
+
ICE_ENUM(ConnectionState, ConnectionStateClosing), // StateClosing
|
|
161
|
+
ICE_ENUM(ConnectionState, ConnectionStateClosing), // StateClosingPending
|
|
162
|
+
ICE_ENUM(ConnectionState, ConnectionStateClosed), // StateClosed
|
|
163
|
+
ICE_ENUM(ConnectionState, ConnectionStateClosed), // StateFinished
|
|
145
164
|
};
|
|
146
165
|
|
|
147
166
|
}
|
|
148
167
|
|
|
168
|
+
ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(const ConnectionIPtr& connection, const InstancePtr& instance) :
|
|
169
|
+
OutgoingAsyncBase(instance), _connection(connection)
|
|
170
|
+
{
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
ConnectionPtr
|
|
174
|
+
ConnectionFlushBatchAsync::getConnection() const
|
|
175
|
+
{
|
|
176
|
+
return _connection;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
void
|
|
180
|
+
ConnectionFlushBatchAsync::invoke(const string& operation, Ice::CompressBatch compressBatch)
|
|
181
|
+
{
|
|
182
|
+
_observer.attach(_instance.get(), operation);
|
|
183
|
+
try
|
|
184
|
+
{
|
|
185
|
+
AsyncStatus status;
|
|
186
|
+
bool compress;
|
|
187
|
+
int batchRequestNum = _connection->getBatchRequestQueue()->swap(&_os, compress);
|
|
188
|
+
if(batchRequestNum == 0)
|
|
189
|
+
{
|
|
190
|
+
status = AsyncStatusSent;
|
|
191
|
+
if(sent())
|
|
192
|
+
{
|
|
193
|
+
status = static_cast<AsyncStatus>(status | AsyncStatusInvokeSentCallback);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
{
|
|
198
|
+
if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, Yes))
|
|
199
|
+
{
|
|
200
|
+
compress = true;
|
|
201
|
+
}
|
|
202
|
+
else if(compressBatch == ICE_SCOPED_ENUM(CompressBatch, No))
|
|
203
|
+
{
|
|
204
|
+
compress = false;
|
|
205
|
+
}
|
|
206
|
+
status = _connection->sendAsyncRequest(ICE_SHARED_FROM_THIS, compress, false, batchRequestNum);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if(status & AsyncStatusSent)
|
|
210
|
+
{
|
|
211
|
+
_sentSynchronously = true;
|
|
212
|
+
if(status & AsyncStatusInvokeSentCallback)
|
|
213
|
+
{
|
|
214
|
+
invokeSent();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
catch(const RetryException& ex)
|
|
219
|
+
{
|
|
220
|
+
if(exception(*ex.get()))
|
|
221
|
+
{
|
|
222
|
+
invokeExceptionAsync();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch(const Exception& ex)
|
|
226
|
+
{
|
|
227
|
+
if(exception(ex))
|
|
228
|
+
{
|
|
229
|
+
invokeExceptionAsync();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
149
234
|
Ice::ConnectionI::Observer::Observer() : _readStreamPos(0), _writeStreamPos(0)
|
|
150
235
|
{
|
|
151
236
|
}
|
|
@@ -209,9 +294,8 @@ Ice::ConnectionI::Observer::attach(const Ice::Instrumentation::ConnectionObserve
|
|
|
209
294
|
}
|
|
210
295
|
}
|
|
211
296
|
|
|
212
|
-
|
|
213
297
|
void
|
|
214
|
-
Ice::ConnectionI::OutgoingMessage::adopt(
|
|
298
|
+
Ice::ConnectionI::OutgoingMessage::adopt(OutputStream* str)
|
|
215
299
|
{
|
|
216
300
|
if(adopted)
|
|
217
301
|
{
|
|
@@ -228,7 +312,7 @@ Ice::ConnectionI::OutgoingMessage::adopt(BasicStream* str)
|
|
|
228
312
|
}
|
|
229
313
|
else if(!str)
|
|
230
314
|
{
|
|
231
|
-
if(
|
|
315
|
+
if(outAsync)
|
|
232
316
|
{
|
|
233
317
|
return; // Adopting request stream is not necessary.
|
|
234
318
|
}
|
|
@@ -240,7 +324,7 @@ Ice::ConnectionI::OutgoingMessage::adopt(BasicStream* str)
|
|
|
240
324
|
}
|
|
241
325
|
|
|
242
326
|
assert(str);
|
|
243
|
-
stream = new
|
|
327
|
+
stream = new OutputStream(str->instance(), currentProtocolEncoding);
|
|
244
328
|
stream->swap(*str);
|
|
245
329
|
adopted = true;
|
|
246
330
|
}
|
|
@@ -248,8 +332,7 @@ Ice::ConnectionI::OutgoingMessage::adopt(BasicStream* str)
|
|
|
248
332
|
void
|
|
249
333
|
Ice::ConnectionI::OutgoingMessage::canceled(bool adoptStream)
|
|
250
334
|
{
|
|
251
|
-
assert(
|
|
252
|
-
out = 0;
|
|
335
|
+
assert(outAsync); // Only requests can timeout.
|
|
253
336
|
outAsync = 0;
|
|
254
337
|
if(adoptStream)
|
|
255
338
|
{
|
|
@@ -270,13 +353,9 @@ Ice::ConnectionI::OutgoingMessage::sent()
|
|
|
270
353
|
}
|
|
271
354
|
stream = 0;
|
|
272
355
|
|
|
273
|
-
if(
|
|
274
|
-
{
|
|
275
|
-
out->sent();
|
|
276
|
-
}
|
|
277
|
-
else if(outAsync)
|
|
356
|
+
if(outAsync)
|
|
278
357
|
{
|
|
279
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
358
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
280
359
|
invokeSent = outAsync->sent();
|
|
281
360
|
return invokeSent || receivedReply;
|
|
282
361
|
#else
|
|
@@ -289,15 +368,11 @@ Ice::ConnectionI::OutgoingMessage::sent()
|
|
|
289
368
|
void
|
|
290
369
|
Ice::ConnectionI::OutgoingMessage::completed(const Ice::LocalException& ex)
|
|
291
370
|
{
|
|
292
|
-
if(
|
|
293
|
-
{
|
|
294
|
-
out->completed(ex);
|
|
295
|
-
}
|
|
296
|
-
else if(outAsync)
|
|
371
|
+
if(outAsync)
|
|
297
372
|
{
|
|
298
|
-
if(outAsync->
|
|
373
|
+
if(outAsync->exception(ex))
|
|
299
374
|
{
|
|
300
|
-
outAsync->
|
|
375
|
+
outAsync->invokeException();
|
|
301
376
|
}
|
|
302
377
|
}
|
|
303
378
|
|
|
@@ -316,7 +391,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback)
|
|
|
316
391
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
317
392
|
if(_state >= StateClosed) // The connection might already be closed if the communicator was destroyed.
|
|
318
393
|
{
|
|
319
|
-
assert(_exception
|
|
394
|
+
assert(_exception);
|
|
320
395
|
_exception->ice_throw();
|
|
321
396
|
}
|
|
322
397
|
|
|
@@ -338,7 +413,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback)
|
|
|
338
413
|
|
|
339
414
|
if(_state >= StateClosing)
|
|
340
415
|
{
|
|
341
|
-
assert(_exception
|
|
416
|
+
assert(_exception);
|
|
342
417
|
_exception->ice_throw();
|
|
343
418
|
}
|
|
344
419
|
}
|
|
@@ -353,7 +428,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback)
|
|
|
353
428
|
exception(ex);
|
|
354
429
|
if(callback)
|
|
355
430
|
{
|
|
356
|
-
callback->connectionStartFailed(
|
|
431
|
+
callback->connectionStartFailed(ICE_SHARED_FROM_THIS, ex);
|
|
357
432
|
return;
|
|
358
433
|
}
|
|
359
434
|
else
|
|
@@ -365,7 +440,7 @@ Ice::ConnectionI::start(const StartCallbackPtr& callback)
|
|
|
365
440
|
|
|
366
441
|
if(callback)
|
|
367
442
|
{
|
|
368
|
-
callback->connectionStartCompleted(
|
|
443
|
+
callback->connectionStartCompleted(ICE_SHARED_FROM_THIS);
|
|
369
444
|
}
|
|
370
445
|
}
|
|
371
446
|
|
|
@@ -418,29 +493,31 @@ Ice::ConnectionI::destroy(DestructionReason reason)
|
|
|
418
493
|
}
|
|
419
494
|
|
|
420
495
|
void
|
|
421
|
-
Ice::ConnectionI::close(
|
|
496
|
+
Ice::ConnectionI::close(ConnectionClose mode)
|
|
422
497
|
{
|
|
423
498
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
424
499
|
|
|
425
|
-
if(
|
|
500
|
+
if(mode == ICE_SCOPED_ENUM(ConnectionClose, Forcefully))
|
|
501
|
+
{
|
|
502
|
+
setState(StateClosed, ConnectionManuallyClosedException(__FILE__, __LINE__, false));
|
|
503
|
+
}
|
|
504
|
+
else if(mode == ICE_SCOPED_ENUM(ConnectionClose, Gracefully))
|
|
426
505
|
{
|
|
427
|
-
setState(
|
|
506
|
+
setState(StateClosing, ConnectionManuallyClosedException(__FILE__, __LINE__, true));
|
|
428
507
|
}
|
|
429
508
|
else
|
|
430
509
|
{
|
|
510
|
+
assert(mode == ICE_SCOPED_ENUM(ConnectionClose, GracefullyWithWait));
|
|
511
|
+
|
|
431
512
|
//
|
|
432
|
-
//
|
|
433
|
-
// outstanding requests have been completed. Otherwise, the
|
|
434
|
-
// CloseConnectionException will cause all outstanding
|
|
435
|
-
// requests to be retried, regardless of whether the server
|
|
436
|
-
// has processed them or not.
|
|
513
|
+
// Wait until all outstanding requests have been completed.
|
|
437
514
|
//
|
|
438
|
-
while(!
|
|
515
|
+
while(!_asyncRequests.empty())
|
|
439
516
|
{
|
|
440
517
|
wait();
|
|
441
518
|
}
|
|
442
519
|
|
|
443
|
-
setState(StateClosing,
|
|
520
|
+
setState(StateClosing, ConnectionManuallyClosedException(__FILE__, __LINE__, true));
|
|
444
521
|
}
|
|
445
522
|
}
|
|
446
523
|
|
|
@@ -486,7 +563,7 @@ Ice::ConnectionI::throwException() const
|
|
|
486
563
|
{
|
|
487
564
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
488
565
|
|
|
489
|
-
if(_exception
|
|
566
|
+
if(_exception)
|
|
490
567
|
{
|
|
491
568
|
assert(_state >= StateClosing);
|
|
492
569
|
_exception->ice_throw();
|
|
@@ -538,10 +615,12 @@ Ice::ConnectionI::updateObserver()
|
|
|
538
615
|
}
|
|
539
616
|
|
|
540
617
|
assert(_instance->initializationData().observer);
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
618
|
+
|
|
619
|
+
ConnectionObserverPtr o = _instance->initializationData().observer->getConnectionObserver(initConnectionInfo(),
|
|
620
|
+
_endpoint,
|
|
621
|
+
toConnectionState(_state),
|
|
622
|
+
_observer.get());
|
|
623
|
+
_observer.attach(o);
|
|
545
624
|
}
|
|
546
625
|
|
|
547
626
|
void
|
|
@@ -557,21 +636,22 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
|
|
|
557
636
|
//
|
|
558
637
|
// We send a heartbeat if there was no activity in the last
|
|
559
638
|
// (timeout / 4) period. Sending a heartbeat sooner than really
|
|
560
|
-
// needed is safer to ensure that the receiver will receive
|
|
561
|
-
//
|
|
639
|
+
// needed is safer to ensure that the receiver will receive the
|
|
640
|
+
// heartbeat in time. Sending the heartbeat if there was no
|
|
562
641
|
// activity in the last (timeout / 2) period isn't enough since
|
|
563
642
|
// monitor() is called only every (timeout / 2) period.
|
|
564
643
|
//
|
|
565
644
|
// Note that this doesn't imply that we are sending 4 heartbeats
|
|
566
|
-
// per timeout period because the monitor() method is
|
|
645
|
+
// per timeout period because the monitor() method is still only
|
|
567
646
|
// called every (timeout / 2) period.
|
|
568
647
|
//
|
|
569
|
-
if(acm.heartbeat == HeartbeatAlways ||
|
|
570
|
-
(acm.heartbeat != HeartbeatOff
|
|
648
|
+
if(acm.heartbeat == ICE_ENUM(ACMHeartbeat, HeartbeatAlways) ||
|
|
649
|
+
(acm.heartbeat != ICE_ENUM(ACMHeartbeat, HeartbeatOff) &&
|
|
650
|
+
_writeStream.b.empty() && now >= (_acmLastActivity + acm.timeout / 4)))
|
|
571
651
|
{
|
|
572
|
-
if(acm.heartbeat !=
|
|
652
|
+
if(acm.heartbeat != ICE_ENUM(ACMHeartbeat, HeartbeatOnDispatch) || _dispatchCount > 0)
|
|
573
653
|
{
|
|
574
|
-
|
|
654
|
+
sendHeartbeatNow();
|
|
575
655
|
}
|
|
576
656
|
}
|
|
577
657
|
|
|
@@ -586,10 +666,10 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
|
|
|
586
666
|
return;
|
|
587
667
|
}
|
|
588
668
|
|
|
589
|
-
if(acm.close != CloseOff && now >= (_acmLastActivity + acm.timeout))
|
|
669
|
+
if(acm.close != ICE_ENUM(ACMClose, CloseOff) && now >= (_acmLastActivity + acm.timeout))
|
|
590
670
|
{
|
|
591
|
-
if(acm.close == CloseOnIdleForceful ||
|
|
592
|
-
(acm.close != CloseOnIdle &&
|
|
671
|
+
if(acm.close == ICE_ENUM(ACMClose, CloseOnIdleForceful) ||
|
|
672
|
+
(acm.close != ICE_ENUM(ACMClose, CloseOnIdle) && !_asyncRequests.empty()))
|
|
593
673
|
{
|
|
594
674
|
//
|
|
595
675
|
// Close the connection if we didn't receive a heartbeat in
|
|
@@ -597,8 +677,8 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
|
|
|
597
677
|
//
|
|
598
678
|
setState(StateClosed, ConnectionTimeoutException(__FILE__, __LINE__));
|
|
599
679
|
}
|
|
600
|
-
else if(acm.close != CloseOnInvocation &&
|
|
601
|
-
_dispatchCount == 0 && _batchRequestQueue->isEmpty() &&
|
|
680
|
+
else if(acm.close != ICE_ENUM(ACMClose, CloseOnInvocation) &&
|
|
681
|
+
_dispatchCount == 0 && _batchRequestQueue->isEmpty() && _asyncRequests.empty())
|
|
602
682
|
{
|
|
603
683
|
//
|
|
604
684
|
// The connection is idle, close it.
|
|
@@ -608,110 +688,21 @@ Ice::ConnectionI::monitor(const IceUtil::Time& now, const ACMConfig& acm)
|
|
|
608
688
|
}
|
|
609
689
|
}
|
|
610
690
|
|
|
611
|
-
bool
|
|
612
|
-
Ice::ConnectionI::sendRequest(OutgoingBase* out, bool compress, bool response, int batchRequestNum)
|
|
613
|
-
{
|
|
614
|
-
BasicStream* os = out->os();
|
|
615
|
-
|
|
616
|
-
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
617
|
-
if(_exception.get())
|
|
618
|
-
{
|
|
619
|
-
//
|
|
620
|
-
// If the connection is closed before we even have a chance
|
|
621
|
-
// to send our request, we always try to send the request
|
|
622
|
-
// again.
|
|
623
|
-
//
|
|
624
|
-
throw RetryException(*_exception.get());
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
assert(_state > StateNotValidated);
|
|
628
|
-
assert(_state < StateClosing);
|
|
629
|
-
|
|
630
|
-
//
|
|
631
|
-
// Ensure the message isn't bigger than what we can send with the
|
|
632
|
-
// transport.
|
|
633
|
-
//
|
|
634
|
-
_transceiver->checkSendSize(*os);
|
|
635
|
-
|
|
636
|
-
Int requestId = 0;
|
|
637
|
-
if(response)
|
|
638
|
-
{
|
|
639
|
-
//
|
|
640
|
-
// Create a new unique request ID.
|
|
641
|
-
//
|
|
642
|
-
requestId = _nextRequestId++;
|
|
643
|
-
if(requestId <= 0)
|
|
644
|
-
{
|
|
645
|
-
_nextRequestId = 1;
|
|
646
|
-
requestId = _nextRequestId++;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
//
|
|
650
|
-
// Fill in the request ID.
|
|
651
|
-
//
|
|
652
|
-
const Byte* p = reinterpret_cast<const Byte*>(&requestId);
|
|
653
|
-
#ifdef ICE_BIG_ENDIAN
|
|
654
|
-
reverse_copy(p, p + sizeof(Int), os->b.begin() + headerSize);
|
|
655
|
-
#else
|
|
656
|
-
copy(p, p + sizeof(Int), os->b.begin() + headerSize);
|
|
657
|
-
#endif
|
|
658
|
-
}
|
|
659
|
-
else if(batchRequestNum > 0)
|
|
660
|
-
{
|
|
661
|
-
const Byte* p = reinterpret_cast<const Byte*>(&batchRequestNum);
|
|
662
|
-
#ifdef ICE_BIG_ENDIAN
|
|
663
|
-
reverse_copy(p, p + sizeof(Int), os->b.begin() + headerSize);
|
|
664
|
-
#else
|
|
665
|
-
copy(p, p + sizeof(Int), os->b.begin() + headerSize);
|
|
666
|
-
#endif
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
out->attachRemoteObserver(initConnectionInfo(), _endpoint, requestId);
|
|
670
|
-
|
|
671
|
-
//
|
|
672
|
-
// Send the message. If it can't be sent without blocking the message is added
|
|
673
|
-
// to _sendStreams and it will be sent by the selector thread.
|
|
674
|
-
//
|
|
675
|
-
bool sent = false;
|
|
676
|
-
try
|
|
677
|
-
{
|
|
678
|
-
OutgoingMessage message(out, os, compress, requestId);
|
|
679
|
-
sent = sendMessage(message) & AsyncStatusSent;
|
|
680
|
-
}
|
|
681
|
-
catch(const LocalException& ex)
|
|
682
|
-
{
|
|
683
|
-
setState(StateClosed, ex);
|
|
684
|
-
assert(_exception.get());
|
|
685
|
-
_exception->ice_throw();
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
if(response)
|
|
689
|
-
{
|
|
690
|
-
//
|
|
691
|
-
// Add to the requests map.
|
|
692
|
-
//
|
|
693
|
-
_requestsHint = _requests.insert(_requests.end(), pair<const Int, OutgoingBase*>(requestId, out));
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
return sent;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
691
|
AsyncStatus
|
|
700
692
|
Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compress, bool response, int batchRequestNum)
|
|
701
693
|
{
|
|
702
|
-
|
|
694
|
+
OutputStream* os = out->getOs();
|
|
703
695
|
|
|
704
696
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
705
|
-
|
|
697
|
+
//
|
|
698
|
+
// If the exception is closed before we even have a chance
|
|
699
|
+
// to send our request, we always try to send the request
|
|
700
|
+
// again.
|
|
701
|
+
//
|
|
702
|
+
if(_exception)
|
|
706
703
|
{
|
|
707
|
-
|
|
708
|
-
// If the exception is closed before we even have a chance
|
|
709
|
-
// to send our request, we always try to send the request
|
|
710
|
-
// again.
|
|
711
|
-
//
|
|
712
|
-
throw RetryException(*_exception.get());
|
|
704
|
+
throw RetryException(*_exception);
|
|
713
705
|
}
|
|
714
|
-
|
|
715
706
|
assert(_state > StateNotValidated);
|
|
716
707
|
assert(_state < StateClosing);
|
|
717
708
|
|
|
@@ -725,8 +716,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres
|
|
|
725
716
|
// Notify the request that it's cancelable with this connection.
|
|
726
717
|
// This will throw if the request is canceled.
|
|
727
718
|
//
|
|
728
|
-
out->cancelable(
|
|
729
|
-
|
|
719
|
+
out->cancelable(ICE_SHARED_FROM_THIS);
|
|
730
720
|
Int requestId = 0;
|
|
731
721
|
if(response)
|
|
732
722
|
{
|
|
@@ -771,7 +761,7 @@ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compres
|
|
|
771
761
|
catch(const LocalException& ex)
|
|
772
762
|
{
|
|
773
763
|
setState(StateClosed, ex);
|
|
774
|
-
assert(_exception
|
|
764
|
+
assert(_exception);
|
|
775
765
|
_exception->ice_throw();
|
|
776
766
|
}
|
|
777
767
|
|
|
@@ -792,137 +782,352 @@ Ice::ConnectionI::getBatchRequestQueue() const
|
|
|
792
782
|
return _batchRequestQueue;
|
|
793
783
|
}
|
|
794
784
|
|
|
785
|
+
#ifdef ICE_CPP11_MAPPING
|
|
786
|
+
std::function<void()>
|
|
787
|
+
Ice::ConnectionI::flushBatchRequestsAsync(CompressBatch compress,
|
|
788
|
+
::std::function<void(::std::exception_ptr)> ex,
|
|
789
|
+
::std::function<void(bool)> sent)
|
|
790
|
+
{
|
|
791
|
+
class ConnectionFlushBatchLambda : public ConnectionFlushBatchAsync, public LambdaInvoke
|
|
792
|
+
{
|
|
793
|
+
public:
|
|
794
|
+
|
|
795
|
+
ConnectionFlushBatchLambda(std::shared_ptr<Ice::ConnectionI>&& connection,
|
|
796
|
+
const InstancePtr& instance,
|
|
797
|
+
std::function<void(std::exception_ptr)> ex,
|
|
798
|
+
std::function<void(bool)> sent) :
|
|
799
|
+
ConnectionFlushBatchAsync(connection, instance), LambdaInvoke(std::move(ex), std::move(sent))
|
|
800
|
+
{
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
auto outAsync = make_shared<ConnectionFlushBatchLambda>(ICE_SHARED_FROM_THIS, _instance, ex, sent);
|
|
804
|
+
outAsync->invoke(flushBatchRequests_name, compress);
|
|
805
|
+
return [outAsync]() { outAsync->cancel(); };
|
|
806
|
+
}
|
|
807
|
+
#else
|
|
795
808
|
void
|
|
796
|
-
Ice::ConnectionI::flushBatchRequests()
|
|
809
|
+
Ice::ConnectionI::flushBatchRequests(CompressBatch compress)
|
|
797
810
|
{
|
|
798
|
-
|
|
799
|
-
out.invoke();
|
|
811
|
+
end_flushBatchRequests(begin_flushBatchRequests(compress));
|
|
800
812
|
}
|
|
801
813
|
|
|
802
814
|
AsyncResultPtr
|
|
803
|
-
Ice::ConnectionI::begin_flushBatchRequests()
|
|
815
|
+
Ice::ConnectionI::begin_flushBatchRequests(CompressBatch compress)
|
|
804
816
|
{
|
|
805
|
-
return
|
|
817
|
+
return _iceI_begin_flushBatchRequests(compress, dummyCallback, 0);
|
|
806
818
|
}
|
|
807
819
|
|
|
808
820
|
AsyncResultPtr
|
|
809
|
-
Ice::ConnectionI::begin_flushBatchRequests(
|
|
821
|
+
Ice::ConnectionI::begin_flushBatchRequests(CompressBatch compress,
|
|
822
|
+
const CallbackPtr& cb,
|
|
823
|
+
const LocalObjectPtr& cookie)
|
|
810
824
|
{
|
|
811
|
-
return
|
|
825
|
+
return _iceI_begin_flushBatchRequests(compress, cb, cookie);
|
|
812
826
|
}
|
|
813
827
|
|
|
814
828
|
AsyncResultPtr
|
|
815
|
-
Ice::ConnectionI::begin_flushBatchRequests(
|
|
829
|
+
Ice::ConnectionI::begin_flushBatchRequests(CompressBatch compress,
|
|
830
|
+
const Callback_Connection_flushBatchRequestsPtr& cb,
|
|
816
831
|
const LocalObjectPtr& cookie)
|
|
817
832
|
{
|
|
818
|
-
return
|
|
833
|
+
return _iceI_begin_flushBatchRequests(compress, cb, cookie);
|
|
819
834
|
}
|
|
820
835
|
|
|
821
836
|
AsyncResultPtr
|
|
822
|
-
Ice::ConnectionI::
|
|
823
|
-
|
|
837
|
+
Ice::ConnectionI::_iceI_begin_flushBatchRequests(CompressBatch compress,
|
|
838
|
+
const CallbackBasePtr& cb,
|
|
839
|
+
const LocalObjectPtr& cookie)
|
|
824
840
|
{
|
|
825
|
-
|
|
826
|
-
class Cpp11CB : public IceInternal::Cpp11FnCallbackNC
|
|
841
|
+
class ConnectionFlushBatchAsyncWithCallback : public ConnectionFlushBatchAsync, public CallbackCompletion
|
|
827
842
|
{
|
|
828
843
|
public:
|
|
829
844
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
845
|
+
ConnectionFlushBatchAsyncWithCallback(const Ice::ConnectionIPtr& connection,
|
|
846
|
+
const Ice::CommunicatorPtr& communicator,
|
|
847
|
+
const InstancePtr& instance,
|
|
848
|
+
const CallbackBasePtr& callback,
|
|
849
|
+
const Ice::LocalObjectPtr& cookie) :
|
|
850
|
+
ConnectionFlushBatchAsync(connection, instance),
|
|
851
|
+
CallbackCompletion(callback, cookie),
|
|
852
|
+
_communicator(communicator),
|
|
853
|
+
_connection(connection)
|
|
854
|
+
{
|
|
855
|
+
_cookie = cookie;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
virtual Ice::CommunicatorPtr getCommunicator() const
|
|
859
|
+
{
|
|
860
|
+
return _communicator;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
virtual Ice::ConnectionPtr getConnection() const
|
|
833
864
|
{
|
|
834
|
-
|
|
865
|
+
return _connection;
|
|
835
866
|
}
|
|
836
867
|
|
|
837
|
-
virtual
|
|
838
|
-
|
|
868
|
+
virtual const std::string&
|
|
869
|
+
getOperation() const
|
|
839
870
|
{
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
871
|
+
return flushBatchRequests_name;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
private:
|
|
875
|
+
|
|
876
|
+
Ice::CommunicatorPtr _communicator;
|
|
877
|
+
Ice::ConnectionPtr _connection;
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
ConnectionFlushBatchAsyncPtr result = new ConnectionFlushBatchAsyncWithCallback(this,
|
|
881
|
+
_communicator,
|
|
882
|
+
_instance,
|
|
883
|
+
cb,
|
|
884
|
+
cookie);
|
|
885
|
+
result->invoke(flushBatchRequests_name, compress);
|
|
886
|
+
return result;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
void
|
|
890
|
+
Ice::ConnectionI::end_flushBatchRequests(const AsyncResultPtr& r)
|
|
891
|
+
{
|
|
892
|
+
AsyncResult::_check(r, this, flushBatchRequests_name);
|
|
893
|
+
r->_waitForResponse();
|
|
894
|
+
}
|
|
895
|
+
#endif
|
|
896
|
+
|
|
897
|
+
namespace
|
|
898
|
+
{
|
|
899
|
+
|
|
900
|
+
const ::std::string heartbeat_name = "heartbeat";
|
|
901
|
+
|
|
902
|
+
class HeartbeatAsync : public OutgoingAsyncBase
|
|
903
|
+
{
|
|
904
|
+
public:
|
|
905
|
+
|
|
906
|
+
HeartbeatAsync(const ConnectionIPtr& connection,
|
|
907
|
+
const CommunicatorPtr& communicator,
|
|
908
|
+
const InstancePtr& instance) :
|
|
909
|
+
OutgoingAsyncBase(instance),
|
|
910
|
+
_communicator(communicator),
|
|
911
|
+
_connection(connection)
|
|
912
|
+
{
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
virtual CommunicatorPtr getCommunicator() const
|
|
916
|
+
{
|
|
917
|
+
return _communicator;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
virtual ConnectionPtr getConnection() const
|
|
921
|
+
{
|
|
922
|
+
return _connection;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
virtual const string& getOperation() const
|
|
926
|
+
{
|
|
927
|
+
return heartbeat_name;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
void invoke()
|
|
931
|
+
{
|
|
932
|
+
_observer.attach(_instance.get(), heartbeat_name);
|
|
933
|
+
try
|
|
934
|
+
{
|
|
935
|
+
_os.write(magic[0]);
|
|
936
|
+
_os.write(magic[1]);
|
|
937
|
+
_os.write(magic[2]);
|
|
938
|
+
_os.write(magic[3]);
|
|
939
|
+
_os.write(currentProtocol);
|
|
940
|
+
_os.write(currentProtocolEncoding);
|
|
941
|
+
_os.write(validateConnectionMsg);
|
|
942
|
+
_os.write(static_cast<Byte>(0)); // Compression status (always zero for validate connection).
|
|
943
|
+
_os.write(headerSize); // Message size.
|
|
944
|
+
_os.i = _os.b.begin();
|
|
945
|
+
|
|
946
|
+
AsyncStatus status = _connection->sendAsyncRequest(ICE_SHARED_FROM_THIS, false, false, 0);
|
|
947
|
+
if(status & AsyncStatusSent)
|
|
948
|
+
{
|
|
949
|
+
_sentSynchronously = true;
|
|
950
|
+
if(status & AsyncStatusInvokeSentCallback)
|
|
951
|
+
{
|
|
952
|
+
invokeSent();
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
catch(const RetryException& ex)
|
|
957
|
+
{
|
|
958
|
+
if(exception(*ex.get()))
|
|
843
959
|
{
|
|
844
|
-
|
|
845
|
-
assert(false);
|
|
960
|
+
invokeExceptionAsync();
|
|
846
961
|
}
|
|
847
|
-
|
|
962
|
+
}
|
|
963
|
+
catch(const Exception& ex)
|
|
964
|
+
{
|
|
965
|
+
if(exception(ex))
|
|
848
966
|
{
|
|
849
|
-
|
|
967
|
+
invokeExceptionAsync();
|
|
850
968
|
}
|
|
851
969
|
}
|
|
852
|
-
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
private:
|
|
973
|
+
|
|
974
|
+
CommunicatorPtr _communicator;
|
|
975
|
+
ConnectionIPtr _connection;
|
|
976
|
+
};
|
|
977
|
+
typedef IceUtil::Handle<HeartbeatAsync> HeartbeatAsyncPtr;
|
|
978
|
+
|
|
979
|
+
}
|
|
853
980
|
|
|
854
|
-
|
|
981
|
+
#ifdef ICE_CPP11_MAPPING
|
|
982
|
+
void
|
|
983
|
+
Ice::ConnectionI::heartbeat()
|
|
984
|
+
{
|
|
985
|
+
Connection::heartbeatAsync().get();
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
std::function<void()>
|
|
989
|
+
Ice::ConnectionI::heartbeatAsync(::std::function<void(::std::exception_ptr)> ex, ::std::function<void(bool)> sent)
|
|
990
|
+
{
|
|
991
|
+
class HeartbeatLambda : public HeartbeatAsync, public LambdaInvoke
|
|
992
|
+
{
|
|
993
|
+
public:
|
|
994
|
+
|
|
995
|
+
HeartbeatLambda(std::shared_ptr<Ice::ConnectionI>&& connection,
|
|
996
|
+
std::shared_ptr<Ice::Communicator>& communicator,
|
|
997
|
+
const InstancePtr& instance,
|
|
998
|
+
std::function<void(std::exception_ptr)> ex,
|
|
999
|
+
std::function<void(bool)> sent) :
|
|
1000
|
+
HeartbeatAsync(connection, communicator, instance), LambdaInvoke(std::move(ex), std::move(sent))
|
|
1001
|
+
{
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
auto outAsync = make_shared<HeartbeatLambda>(ICE_SHARED_FROM_THIS, _communicator, _instance, ex, sent);
|
|
1005
|
+
outAsync->invoke();
|
|
1006
|
+
return [outAsync]() { outAsync->cancel(); };
|
|
1007
|
+
}
|
|
855
1008
|
#else
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1009
|
+
void
|
|
1010
|
+
Ice::ConnectionI::heartbeat()
|
|
1011
|
+
{
|
|
1012
|
+
end_heartbeat(begin_heartbeat());
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
AsyncResultPtr
|
|
1016
|
+
Ice::ConnectionI::begin_heartbeat()
|
|
1017
|
+
{
|
|
1018
|
+
return _iceI_begin_heartbeat(dummyCallback, 0);
|
|
859
1019
|
}
|
|
860
1020
|
|
|
861
1021
|
AsyncResultPtr
|
|
862
|
-
Ice::ConnectionI::
|
|
863
|
-
{
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
1022
|
+
Ice::ConnectionI::begin_heartbeat(const CallbackPtr& cb, const LocalObjectPtr& cookie)
|
|
1023
|
+
{
|
|
1024
|
+
return _iceI_begin_heartbeat(cb, cookie);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
AsyncResultPtr
|
|
1028
|
+
Ice::ConnectionI::begin_heartbeat(const Callback_Connection_heartbeatPtr& cb, const LocalObjectPtr& cookie)
|
|
1029
|
+
{
|
|
1030
|
+
return _iceI_begin_heartbeat(cb, cookie);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
AsyncResultPtr
|
|
1034
|
+
Ice::ConnectionI::_iceI_begin_heartbeat(const CallbackBasePtr& cb, const LocalObjectPtr& cookie)
|
|
1035
|
+
{
|
|
1036
|
+
class HeartbeatCallback : public HeartbeatAsync, public CallbackCompletion
|
|
1037
|
+
{
|
|
1038
|
+
public:
|
|
1039
|
+
|
|
1040
|
+
HeartbeatCallback(const ConnectionIPtr& connection,
|
|
1041
|
+
const CommunicatorPtr& communicator,
|
|
1042
|
+
const InstancePtr& instance,
|
|
1043
|
+
const CallbackBasePtr& callback,
|
|
1044
|
+
const LocalObjectPtr& cookie) :
|
|
1045
|
+
HeartbeatAsync(connection, communicator, instance),
|
|
1046
|
+
CallbackCompletion(callback, cookie)
|
|
1047
|
+
{
|
|
1048
|
+
_cookie = cookie;
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
HeartbeatAsyncPtr result = new HeartbeatCallback(this, _communicator, _instance, cb, cookie);
|
|
870
1053
|
result->invoke();
|
|
871
1054
|
return result;
|
|
872
1055
|
}
|
|
873
1056
|
|
|
874
1057
|
void
|
|
875
|
-
Ice::ConnectionI::
|
|
1058
|
+
Ice::ConnectionI::end_heartbeat(const AsyncResultPtr& r)
|
|
876
1059
|
{
|
|
877
|
-
AsyncResult::
|
|
878
|
-
r->
|
|
1060
|
+
AsyncResult::_check(r, this, heartbeat_name);
|
|
1061
|
+
r->_waitForResponse();
|
|
879
1062
|
}
|
|
1063
|
+
#endif
|
|
880
1064
|
|
|
881
1065
|
void
|
|
882
|
-
Ice::ConnectionI::
|
|
1066
|
+
Ice::ConnectionI::setHeartbeatCallback(ICE_IN(ICE_DELEGATE(HeartbeatCallback)) callback)
|
|
883
1067
|
{
|
|
1068
|
+
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
1069
|
+
if(_state >= StateClosed)
|
|
884
1070
|
{
|
|
885
|
-
|
|
886
|
-
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
_heartbeatCallback = callback;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
void
|
|
1077
|
+
Ice::ConnectionI::setCloseCallback(ICE_IN(ICE_DELEGATE(CloseCallback)) callback)
|
|
1078
|
+
{
|
|
1079
|
+
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
1080
|
+
if(_state >= StateClosed)
|
|
1081
|
+
{
|
|
1082
|
+
if(callback)
|
|
887
1083
|
{
|
|
888
|
-
|
|
1084
|
+
class CallbackWorkItem : public DispatchWorkItem
|
|
889
1085
|
{
|
|
890
|
-
|
|
891
|
-
{
|
|
892
|
-
public:
|
|
1086
|
+
public:
|
|
893
1087
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1088
|
+
CallbackWorkItem(const ConnectionIPtr& connection, ICE_IN(ICE_DELEGATE(CloseCallback)) callback) :
|
|
1089
|
+
_connection(connection),
|
|
1090
|
+
#ifdef ICE_CPP11_MAPPING
|
|
1091
|
+
_callback(move(callback))
|
|
1092
|
+
#else
|
|
1093
|
+
_callback(callback)
|
|
1094
|
+
#endif
|
|
1095
|
+
{
|
|
1096
|
+
}
|
|
899
1097
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
1098
|
+
virtual void run()
|
|
1099
|
+
{
|
|
1100
|
+
_connection->closeCallback(_callback);
|
|
1101
|
+
}
|
|
904
1102
|
|
|
905
|
-
|
|
1103
|
+
private:
|
|
906
1104
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
_callback = callback;
|
|
1105
|
+
const ConnectionIPtr _connection;
|
|
1106
|
+
const ICE_DELEGATE(CloseCallback) _callback;
|
|
1107
|
+
};
|
|
1108
|
+
#ifdef ICE_CPP11_MAPPING
|
|
1109
|
+
_threadPool->dispatch(new CallbackWorkItem(ICE_SHARED_FROM_THIS, move(callback)));
|
|
1110
|
+
#else
|
|
1111
|
+
_threadPool->dispatch(new CallbackWorkItem(ICE_SHARED_FROM_THIS, callback));
|
|
1112
|
+
#endif
|
|
916
1113
|
}
|
|
917
1114
|
}
|
|
1115
|
+
else
|
|
1116
|
+
{
|
|
1117
|
+
_closeCallback = callback;
|
|
1118
|
+
}
|
|
918
1119
|
}
|
|
919
1120
|
|
|
920
1121
|
void
|
|
921
|
-
Ice::ConnectionI::closeCallback(const
|
|
1122
|
+
Ice::ConnectionI::closeCallback(const ICE_DELEGATE(CloseCallback)& callback)
|
|
922
1123
|
{
|
|
923
1124
|
try
|
|
924
1125
|
{
|
|
925
|
-
|
|
1126
|
+
#ifdef ICE_CPP11_MAPPING
|
|
1127
|
+
callback(ICE_SHARED_FROM_THIS);
|
|
1128
|
+
#else
|
|
1129
|
+
callback->closed(ICE_SHARED_FROM_THIS);
|
|
1130
|
+
#endif
|
|
926
1131
|
}
|
|
927
1132
|
catch(const std::exception& ex)
|
|
928
1133
|
{
|
|
@@ -945,130 +1150,40 @@ Ice::ConnectionI::setACM(const IceUtil::Optional<int>& timeout,
|
|
|
945
1150
|
if(!_monitor || _state >= StateClosed)
|
|
946
1151
|
{
|
|
947
1152
|
return;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
if(_state == StateActive)
|
|
951
|
-
{
|
|
952
|
-
_monitor->remove(this);
|
|
953
|
-
}
|
|
954
|
-
_monitor = _monitor->acm(timeout, close, heartbeat);
|
|
955
|
-
|
|
956
|
-
if(_monitor->getACM().timeout <= 0)
|
|
957
|
-
{
|
|
958
|
-
_acmLastActivity = IceUtil::Time(); // Disable the recording of last activity.
|
|
959
|
-
}
|
|
960
|
-
else if(_acmLastActivity == IceUtil::Time() && _state == StateActive)
|
|
961
|
-
{
|
|
962
|
-
_acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic);
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
if(_state == StateActive)
|
|
966
|
-
{
|
|
967
|
-
_monitor->add(this);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
ACM
|
|
972
|
-
Ice::ConnectionI::getACM()
|
|
973
|
-
{
|
|
974
|
-
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
975
|
-
ACM acm;
|
|
976
|
-
acm.timeout = 0;
|
|
977
|
-
acm.close = CloseOff;
|
|
978
|
-
acm.heartbeat = HeartbeatOff;
|
|
979
|
-
return _monitor ? _monitor->getACM() : acm;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
void
|
|
983
|
-
Ice::ConnectionI::requestCanceled(OutgoingBase* out, const Ice::LocalException& ex)
|
|
984
|
-
{
|
|
985
|
-
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
986
|
-
if(_state >= StateClosed)
|
|
987
|
-
{
|
|
988
|
-
return; // The request has already been or will be shortly notified of the failure.
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
for(deque<OutgoingMessage>::iterator o = _sendStreams.begin(); o != _sendStreams.end(); ++o)
|
|
992
|
-
{
|
|
993
|
-
if(o->out == out)
|
|
994
|
-
{
|
|
995
|
-
if(o->requestId)
|
|
996
|
-
{
|
|
997
|
-
if(_requestsHint != _requests.end() && _requestsHint->second == out)
|
|
998
|
-
{
|
|
999
|
-
_requests.erase(_requestsHint);
|
|
1000
|
-
_requestsHint = _requests.end();
|
|
1001
|
-
}
|
|
1002
|
-
else
|
|
1003
|
-
{
|
|
1004
|
-
_requests.erase(o->requestId);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1153
|
+
}
|
|
1007
1154
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
}
|
|
1012
|
-
else
|
|
1013
|
-
{
|
|
1014
|
-
//
|
|
1015
|
-
// If the request is being sent, don't remove it from the send streams,
|
|
1016
|
-
// it will be removed once the sending is finished.
|
|
1017
|
-
//
|
|
1018
|
-
if(o == _sendStreams.begin())
|
|
1019
|
-
{
|
|
1020
|
-
o->canceled(true); // true = adopt the stream.
|
|
1021
|
-
}
|
|
1022
|
-
else
|
|
1023
|
-
{
|
|
1024
|
-
o->canceled(false);
|
|
1025
|
-
_sendStreams.erase(o);
|
|
1026
|
-
}
|
|
1027
|
-
out->completed(ex);
|
|
1028
|
-
}
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1155
|
+
if(_state == StateActive)
|
|
1156
|
+
{
|
|
1157
|
+
_monitor->remove(ICE_SHARED_FROM_THIS);
|
|
1031
1158
|
}
|
|
1159
|
+
_monitor = _monitor->acm(timeout, close, heartbeat);
|
|
1032
1160
|
|
|
1033
|
-
if(
|
|
1161
|
+
if(_monitor->getACM().timeout <= 0)
|
|
1034
1162
|
{
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
_requestsHint = _requests.end();
|
|
1046
|
-
}
|
|
1047
|
-
return;
|
|
1048
|
-
}
|
|
1049
|
-
else
|
|
1050
|
-
{
|
|
1051
|
-
for(map<Int, OutgoingBase*>::iterator p = _requests.begin(); p != _requests.end(); ++p)
|
|
1052
|
-
{
|
|
1053
|
-
if(p->second == out)
|
|
1054
|
-
{
|
|
1055
|
-
if(dynamic_cast<const Ice::ConnectionTimeoutException*>(&ex))
|
|
1056
|
-
{
|
|
1057
|
-
setState(StateClosed, ex);
|
|
1058
|
-
}
|
|
1059
|
-
else
|
|
1060
|
-
{
|
|
1061
|
-
p->second->completed(ex);
|
|
1062
|
-
assert(p != _requestsHint);
|
|
1063
|
-
_requests.erase(p);
|
|
1064
|
-
}
|
|
1065
|
-
return; // We're done.
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1163
|
+
_acmLastActivity = IceUtil::Time(); // Disable the recording of last activity.
|
|
1164
|
+
}
|
|
1165
|
+
else if(_acmLastActivity == IceUtil::Time() && _state == StateActive)
|
|
1166
|
+
{
|
|
1167
|
+
_acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
if(_state == StateActive)
|
|
1171
|
+
{
|
|
1172
|
+
_monitor->add(ICE_SHARED_FROM_THIS);
|
|
1069
1173
|
}
|
|
1070
1174
|
}
|
|
1071
1175
|
|
|
1176
|
+
ACM
|
|
1177
|
+
Ice::ConnectionI::getACM()
|
|
1178
|
+
{
|
|
1179
|
+
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
1180
|
+
ACM acm;
|
|
1181
|
+
acm.timeout = 0;
|
|
1182
|
+
acm.close = ICE_ENUM(ACMClose, CloseOff);
|
|
1183
|
+
acm.heartbeat = ICE_ENUM(ACMHeartbeat, HeartbeatOff);
|
|
1184
|
+
return _monitor ? _monitor->getACM() : acm;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1072
1187
|
void
|
|
1073
1188
|
Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, const LocalException& ex)
|
|
1074
1189
|
{
|
|
@@ -1089,7 +1204,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con
|
|
|
1089
1204
|
if(o->requestId)
|
|
1090
1205
|
{
|
|
1091
1206
|
if(_asyncRequestsHint != _asyncRequests.end() &&
|
|
1092
|
-
_asyncRequestsHint->second ==
|
|
1207
|
+
_asyncRequestsHint->second == ICE_DYNAMIC_CAST(OutgoingAsync, outAsync))
|
|
1093
1208
|
{
|
|
1094
1209
|
_asyncRequests.erase(_asyncRequestsHint);
|
|
1095
1210
|
_asyncRequestsHint = _asyncRequests.end();
|
|
@@ -1119,16 +1234,16 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con
|
|
|
1119
1234
|
o->canceled(false);
|
|
1120
1235
|
_sendStreams.erase(o);
|
|
1121
1236
|
}
|
|
1122
|
-
if(outAsync->
|
|
1237
|
+
if(outAsync->exception(ex))
|
|
1123
1238
|
{
|
|
1124
|
-
outAsync->
|
|
1239
|
+
outAsync->invokeExceptionAsync();
|
|
1125
1240
|
}
|
|
1126
1241
|
}
|
|
1127
1242
|
return;
|
|
1128
1243
|
}
|
|
1129
1244
|
}
|
|
1130
1245
|
|
|
1131
|
-
if(
|
|
1246
|
+
if(ICE_DYNAMIC_CAST(OutgoingAsync, outAsync))
|
|
1132
1247
|
{
|
|
1133
1248
|
if(_asyncRequestsHint != _asyncRequests.end())
|
|
1134
1249
|
{
|
|
@@ -1142,9 +1257,9 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con
|
|
|
1142
1257
|
{
|
|
1143
1258
|
_asyncRequests.erase(_asyncRequestsHint);
|
|
1144
1259
|
_asyncRequestsHint = _asyncRequests.end();
|
|
1145
|
-
if(outAsync->
|
|
1260
|
+
if(outAsync->exception(ex))
|
|
1146
1261
|
{
|
|
1147
|
-
outAsync->
|
|
1262
|
+
outAsync->invokeExceptionAsync();
|
|
1148
1263
|
}
|
|
1149
1264
|
}
|
|
1150
1265
|
return;
|
|
@@ -1163,9 +1278,9 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con
|
|
|
1163
1278
|
{
|
|
1164
1279
|
assert(p != _asyncRequestsHint);
|
|
1165
1280
|
_asyncRequests.erase(p);
|
|
1166
|
-
if(outAsync->
|
|
1281
|
+
if(outAsync->exception(ex))
|
|
1167
1282
|
{
|
|
1168
|
-
outAsync->
|
|
1283
|
+
outAsync->invokeExceptionAsync();
|
|
1169
1284
|
}
|
|
1170
1285
|
}
|
|
1171
1286
|
return;
|
|
@@ -1175,7 +1290,7 @@ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, con
|
|
|
1175
1290
|
}
|
|
1176
1291
|
|
|
1177
1292
|
void
|
|
1178
|
-
Ice::ConnectionI::sendResponse(Int,
|
|
1293
|
+
Ice::ConnectionI::sendResponse(Int, OutputStream* os, Byte compressFlag, bool /*amd*/)
|
|
1179
1294
|
{
|
|
1180
1295
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
1181
1296
|
assert(_state > StateNotValidated);
|
|
@@ -1193,7 +1308,7 @@ Ice::ConnectionI::sendResponse(Int, BasicStream* os, Byte compressFlag, bool /*a
|
|
|
1193
1308
|
|
|
1194
1309
|
if(_state >= StateClosed)
|
|
1195
1310
|
{
|
|
1196
|
-
assert(_exception
|
|
1311
|
+
assert(_exception);
|
|
1197
1312
|
_exception->ice_throw();
|
|
1198
1313
|
}
|
|
1199
1314
|
|
|
@@ -1232,7 +1347,7 @@ Ice::ConnectionI::sendNoResponse()
|
|
|
1232
1347
|
|
|
1233
1348
|
if(_state >= StateClosed)
|
|
1234
1349
|
{
|
|
1235
|
-
assert(_exception
|
|
1350
|
+
assert(_exception);
|
|
1236
1351
|
_exception->ice_throw();
|
|
1237
1352
|
}
|
|
1238
1353
|
|
|
@@ -1335,18 +1450,18 @@ Ice::ConnectionI::getEndpoint() const
|
|
|
1335
1450
|
return _endpoint; // No mutex protection necessary, _endpoint is immutable.
|
|
1336
1451
|
}
|
|
1337
1452
|
|
|
1338
|
-
|
|
1453
|
+
ObjectPrxPtr
|
|
1339
1454
|
Ice::ConnectionI::createProxy(const Identity& ident) const
|
|
1340
1455
|
{
|
|
1341
1456
|
//
|
|
1342
1457
|
// Create a reference and return a reverse proxy for this
|
|
1343
1458
|
// reference.
|
|
1344
1459
|
//
|
|
1345
|
-
|
|
1346
|
-
|
|
1460
|
+
return _instance->proxyFactory()->referenceToProxy(
|
|
1461
|
+
_instance->referenceFactory()->create(ident, ICE_SHARED_FROM_CONST_THIS(ConnectionI)));
|
|
1347
1462
|
}
|
|
1348
1463
|
|
|
1349
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
1464
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
1350
1465
|
bool
|
|
1351
1466
|
Ice::ConnectionI::startAsync(SocketOperation operation)
|
|
1352
1467
|
{
|
|
@@ -1372,19 +1487,12 @@ Ice::ConnectionI::startAsync(SocketOperation operation)
|
|
|
1372
1487
|
}
|
|
1373
1488
|
else if(operation & SocketOperationRead)
|
|
1374
1489
|
{
|
|
1375
|
-
if(!
|
|
1376
|
-
{
|
|
1377
|
-
if(_observer && !_readHeader)
|
|
1378
|
-
{
|
|
1379
|
-
_observer.startRead(_readStream);
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
_transceiver->startRead(_readStream);
|
|
1383
|
-
}
|
|
1384
|
-
else
|
|
1490
|
+
if(_observer && !_readHeader)
|
|
1385
1491
|
{
|
|
1386
|
-
|
|
1492
|
+
_observer.startRead(_readStream);
|
|
1387
1493
|
}
|
|
1494
|
+
|
|
1495
|
+
_transceiver->startRead(_readStream);
|
|
1388
1496
|
}
|
|
1389
1497
|
}
|
|
1390
1498
|
catch(const Ice::LocalException& ex)
|
|
@@ -1422,29 +1530,26 @@ Ice::ConnectionI::finishAsync(SocketOperation operation)
|
|
|
1422
1530
|
}
|
|
1423
1531
|
else if(operation & SocketOperationRead)
|
|
1424
1532
|
{
|
|
1425
|
-
|
|
1533
|
+
Buffer::Container::iterator start = _readStream.i;
|
|
1534
|
+
_transceiver->finishRead(_readStream);
|
|
1535
|
+
if(_instance->traceLevels()->network >= 3 && _readStream.i != start)
|
|
1426
1536
|
{
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
if(
|
|
1537
|
+
Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
|
|
1538
|
+
out << "received ";
|
|
1539
|
+
if(_endpoint->datagram())
|
|
1430
1540
|
{
|
|
1431
|
-
|
|
1432
|
-
out << "received ";
|
|
1433
|
-
if(_endpoint->datagram())
|
|
1434
|
-
{
|
|
1435
|
-
out << _readStream.b.size();
|
|
1436
|
-
}
|
|
1437
|
-
else
|
|
1438
|
-
{
|
|
1439
|
-
out << (_readStream.i - start) << " of " << (_readStream.b.end() - start);
|
|
1440
|
-
}
|
|
1441
|
-
out << " bytes via " << _endpoint->protocol() << "\n" << toString();
|
|
1541
|
+
out << _readStream.b.size();
|
|
1442
1542
|
}
|
|
1443
|
-
|
|
1444
|
-
if(_observer && !_readHeader)
|
|
1543
|
+
else
|
|
1445
1544
|
{
|
|
1446
|
-
|
|
1545
|
+
out << (_readStream.i - start) << " of " << (_readStream.b.end() - start);
|
|
1447
1546
|
}
|
|
1547
|
+
out << " bytes via " << _endpoint->protocol() << "\n" << toString();
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
if(_observer && !_readHeader)
|
|
1551
|
+
{
|
|
1552
|
+
_observer.finishRead(_readStream);
|
|
1448
1553
|
}
|
|
1449
1554
|
}
|
|
1450
1555
|
}
|
|
@@ -1467,11 +1572,10 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
|
|
|
1467
1572
|
ServantManagerPtr servantManager;
|
|
1468
1573
|
ObjectAdapterPtr adapter;
|
|
1469
1574
|
OutgoingAsyncBasePtr outAsync;
|
|
1470
|
-
|
|
1575
|
+
ICE_DELEGATE(HeartbeatCallback) heartbeatCallback;
|
|
1471
1576
|
int dispatchCount = 0;
|
|
1472
1577
|
|
|
1473
1578
|
ThreadPoolMessage<ConnectionI> msg(current, *this);
|
|
1474
|
-
|
|
1475
1579
|
{
|
|
1476
1580
|
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
|
|
1477
1581
|
|
|
@@ -1603,7 +1707,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
|
|
|
1603
1707
|
// satisfied before continuing.
|
|
1604
1708
|
//
|
|
1605
1709
|
scheduleTimeout(newOp);
|
|
1606
|
-
_threadPool->update(
|
|
1710
|
+
_threadPool->update(ICE_SHARED_FROM_THIS, current.operation, newOp);
|
|
1607
1711
|
return;
|
|
1608
1712
|
}
|
|
1609
1713
|
|
|
@@ -1617,7 +1721,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
|
|
|
1617
1721
|
return;
|
|
1618
1722
|
}
|
|
1619
1723
|
|
|
1620
|
-
_threadPool->unregister(
|
|
1724
|
+
_threadPool->unregister(ICE_SHARED_FROM_THIS, current.operation);
|
|
1621
1725
|
|
|
1622
1726
|
//
|
|
1623
1727
|
// We start out in holding state.
|
|
@@ -1665,7 +1769,7 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
|
|
|
1665
1769
|
if(_state < StateClosed)
|
|
1666
1770
|
{
|
|
1667
1771
|
scheduleTimeout(newOp);
|
|
1668
|
-
_threadPool->update(
|
|
1772
|
+
_threadPool->update(ICE_SHARED_FROM_THIS, current.operation, newOp);
|
|
1669
1773
|
}
|
|
1670
1774
|
}
|
|
1671
1775
|
|
|
@@ -1727,9 +1831,10 @@ Ice::ConnectionI::message(ThreadPoolCurrent& current)
|
|
|
1727
1831
|
}
|
|
1728
1832
|
else
|
|
1729
1833
|
{
|
|
1730
|
-
_threadPool->dispatchFromThisThread(new DispatchCall(
|
|
1731
|
-
servantManager, adapter, outAsync,
|
|
1732
|
-
current.stream));
|
|
1834
|
+
_threadPool->dispatchFromThisThread(new DispatchCall(ICE_SHARED_FROM_THIS, startCB, sentCBs, compress, requestId,
|
|
1835
|
+
invokeNum, servantManager, adapter, outAsync,
|
|
1836
|
+
heartbeatCallback, current.stream));
|
|
1837
|
+
|
|
1733
1838
|
}
|
|
1734
1839
|
}
|
|
1735
1840
|
|
|
@@ -1737,7 +1842,7 @@ void
|
|
|
1737
1842
|
ConnectionI::dispatch(const StartCallbackPtr& startCB, const vector<OutgoingMessage>& sentCBs,
|
|
1738
1843
|
Byte compress, Int requestId, Int invokeNum, const ServantManagerPtr& servantManager,
|
|
1739
1844
|
const ObjectAdapterPtr& adapter, const OutgoingAsyncBasePtr& outAsync,
|
|
1740
|
-
const
|
|
1845
|
+
const ICE_DELEGATE(HeartbeatCallback)& heartbeatCallback, InputStream& stream)
|
|
1741
1846
|
{
|
|
1742
1847
|
int dispatchedCount = 0;
|
|
1743
1848
|
|
|
@@ -1747,7 +1852,7 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vector<OutgoingMess
|
|
|
1747
1852
|
//
|
|
1748
1853
|
if(startCB)
|
|
1749
1854
|
{
|
|
1750
|
-
startCB->connectionStartCompleted(
|
|
1855
|
+
startCB->connectionStartCompleted(ICE_SHARED_FROM_THIS);
|
|
1751
1856
|
++dispatchedCount;
|
|
1752
1857
|
}
|
|
1753
1858
|
|
|
@@ -1758,17 +1863,17 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vector<OutgoingMess
|
|
|
1758
1863
|
{
|
|
1759
1864
|
for(vector<OutgoingMessage>::const_iterator p = sentCBs.begin(); p != sentCBs.end(); ++p)
|
|
1760
1865
|
{
|
|
1761
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
1866
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
1762
1867
|
if(p->invokeSent)
|
|
1763
1868
|
{
|
|
1764
1869
|
p->outAsync->invokeSent();
|
|
1765
1870
|
}
|
|
1766
1871
|
if(p->receivedReply)
|
|
1767
1872
|
{
|
|
1768
|
-
OutgoingAsyncPtr
|
|
1769
|
-
if(
|
|
1873
|
+
OutgoingAsyncPtr o = ICE_DYNAMIC_CAST(OutgoingAsync, p->outAsync);
|
|
1874
|
+
if(o->response())
|
|
1770
1875
|
{
|
|
1771
|
-
|
|
1876
|
+
o->invokeResponse();
|
|
1772
1877
|
}
|
|
1773
1878
|
}
|
|
1774
1879
|
#else
|
|
@@ -1784,7 +1889,7 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vector<OutgoingMess
|
|
|
1784
1889
|
//
|
|
1785
1890
|
if(outAsync)
|
|
1786
1891
|
{
|
|
1787
|
-
outAsync->
|
|
1892
|
+
outAsync->invokeResponse();
|
|
1788
1893
|
++dispatchedCount;
|
|
1789
1894
|
}
|
|
1790
1895
|
|
|
@@ -1792,7 +1897,11 @@ ConnectionI::dispatch(const StartCallbackPtr& startCB, const vector<OutgoingMess
|
|
|
1792
1897
|
{
|
|
1793
1898
|
try
|
|
1794
1899
|
{
|
|
1795
|
-
|
|
1900
|
+
#ifdef ICE_CPP11_MAPPING
|
|
1901
|
+
heartbeatCallback(ICE_SHARED_FROM_THIS);
|
|
1902
|
+
#else
|
|
1903
|
+
heartbeatCallback->heartbeat(ICE_SHARED_FROM_THIS);
|
|
1904
|
+
#endif
|
|
1796
1905
|
}
|
|
1797
1906
|
catch(const std::exception& ex)
|
|
1798
1907
|
{
|
|
@@ -1871,7 +1980,7 @@ Ice::ConnectionI::finished(ThreadPoolCurrent& current, bool close)
|
|
|
1871
1980
|
// to call code that will potentially block (this avoids promoting a new leader and
|
|
1872
1981
|
// unecessary thread creation, especially if this is called on shutdown).
|
|
1873
1982
|
//
|
|
1874
|
-
if(!_startCallback && _sendStreams.empty() && _asyncRequests.empty() && !
|
|
1983
|
+
if(!_startCallback && _sendStreams.empty() && _asyncRequests.empty() && !_closeCallback && !_heartbeatCallback)
|
|
1875
1984
|
{
|
|
1876
1985
|
finish(close);
|
|
1877
1986
|
return;
|
|
@@ -1884,7 +1993,7 @@ Ice::ConnectionI::finished(ThreadPoolCurrent& current, bool close)
|
|
|
1884
1993
|
}
|
|
1885
1994
|
else
|
|
1886
1995
|
{
|
|
1887
|
-
_threadPool->dispatchFromThisThread(new FinishCall(
|
|
1996
|
+
_threadPool->dispatchFromThisThread(new FinishCall(ICE_SHARED_FROM_THIS, close));
|
|
1888
1997
|
}
|
|
1889
1998
|
}
|
|
1890
1999
|
|
|
@@ -1897,8 +2006,9 @@ Ice::ConnectionI::finish(bool close)
|
|
|
1897
2006
|
{
|
|
1898
2007
|
string verb = _connector ? "establish" : "accept";
|
|
1899
2008
|
Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
|
|
2009
|
+
|
|
1900
2010
|
out << "failed to " << verb << " " << _endpoint->protocol() << " connection\n" << toString()
|
|
1901
|
-
<< "\n" << *_exception
|
|
2011
|
+
<< "\n" << *_exception;
|
|
1902
2012
|
}
|
|
1903
2013
|
}
|
|
1904
2014
|
else
|
|
@@ -1908,28 +2018,35 @@ Ice::ConnectionI::finish(bool close)
|
|
|
1908
2018
|
Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
|
|
1909
2019
|
out << "closed " << _endpoint->protocol() << " connection\n" << toString();
|
|
1910
2020
|
|
|
1911
|
-
//
|
|
1912
|
-
// Trace the cause of unexpected connection closures
|
|
1913
|
-
//
|
|
1914
2021
|
if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) ||
|
|
1915
|
-
dynamic_cast<const
|
|
2022
|
+
dynamic_cast<const ConnectionManuallyClosedException*>(_exception.get()) ||
|
|
1916
2023
|
dynamic_cast<const ConnectionTimeoutException*>(_exception.get()) ||
|
|
1917
2024
|
dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) ||
|
|
1918
2025
|
dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get())))
|
|
1919
2026
|
{
|
|
1920
|
-
out << "\n" << *_exception
|
|
2027
|
+
out << "\n" << *_exception;
|
|
1921
2028
|
}
|
|
1922
2029
|
}
|
|
1923
2030
|
}
|
|
1924
2031
|
|
|
1925
2032
|
if(close)
|
|
1926
2033
|
{
|
|
1927
|
-
|
|
2034
|
+
try
|
|
2035
|
+
{
|
|
2036
|
+
_transceiver->close();
|
|
2037
|
+
}
|
|
2038
|
+
catch(const Ice::LocalException& ex)
|
|
2039
|
+
{
|
|
2040
|
+
Error out(_logger);
|
|
2041
|
+
out << "unexpected connection exception:\n" << ex << '\n' << _desc;
|
|
2042
|
+
}
|
|
1928
2043
|
}
|
|
1929
2044
|
|
|
1930
2045
|
if(_startCallback)
|
|
1931
2046
|
{
|
|
1932
|
-
|
|
2047
|
+
assert(_exception);
|
|
2048
|
+
|
|
2049
|
+
_startCallback->connectionStartFailed(ICE_SHARED_FROM_THIS, *_exception);
|
|
1933
2050
|
_startCallback = 0;
|
|
1934
2051
|
}
|
|
1935
2052
|
|
|
@@ -1944,7 +2061,7 @@ Ice::ConnectionI::finish(bool close)
|
|
|
1944
2061
|
OutgoingMessage* message = &_sendStreams.front();
|
|
1945
2062
|
_writeStream.swap(*message->stream);
|
|
1946
2063
|
|
|
1947
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
2064
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
1948
2065
|
//
|
|
1949
2066
|
// The current message might be sent but not yet removed from _sendStreams. If
|
|
1950
2067
|
// the response has been received in the meantime, we remove the message from
|
|
@@ -1958,10 +2075,10 @@ Ice::ConnectionI::finish(bool close)
|
|
|
1958
2075
|
}
|
|
1959
2076
|
if(message->receivedReply)
|
|
1960
2077
|
{
|
|
1961
|
-
OutgoingAsyncPtr outAsync =
|
|
1962
|
-
if(outAsync->
|
|
2078
|
+
OutgoingAsyncPtr outAsync = ICE_DYNAMIC_CAST(OutgoingAsync, message->outAsync);
|
|
2079
|
+
if(outAsync->response())
|
|
1963
2080
|
{
|
|
1964
|
-
outAsync->
|
|
2081
|
+
outAsync->invokeResponse();
|
|
1965
2082
|
}
|
|
1966
2083
|
}
|
|
1967
2084
|
_sendStreams.pop_front();
|
|
@@ -1971,35 +2088,24 @@ Ice::ConnectionI::finish(bool close)
|
|
|
1971
2088
|
|
|
1972
2089
|
for(deque<OutgoingMessage>::iterator o = _sendStreams.begin(); o != _sendStreams.end(); ++o)
|
|
1973
2090
|
{
|
|
1974
|
-
o->completed(*_exception
|
|
2091
|
+
o->completed(*_exception);
|
|
1975
2092
|
if(o->requestId) // Make sure finished isn't called twice.
|
|
1976
2093
|
{
|
|
1977
|
-
|
|
1978
|
-
{
|
|
1979
|
-
_requests.erase(o->requestId);
|
|
1980
|
-
}
|
|
1981
|
-
else
|
|
1982
|
-
{
|
|
1983
|
-
_asyncRequests.erase(o->requestId);
|
|
1984
|
-
}
|
|
2094
|
+
_asyncRequests.erase(o->requestId);
|
|
1985
2095
|
}
|
|
1986
2096
|
}
|
|
1987
|
-
_sendStreams.clear(); // Must be cleared before _requests because of Outgoing* references in OutgoingMessage
|
|
1988
|
-
}
|
|
1989
2097
|
|
|
1990
|
-
|
|
1991
|
-
{
|
|
1992
|
-
p->second->completed(*_exception.get());
|
|
2098
|
+
_sendStreams.clear();
|
|
1993
2099
|
}
|
|
1994
|
-
_requests.clear();
|
|
1995
2100
|
|
|
1996
2101
|
for(map<Int, OutgoingAsyncBasePtr>::const_iterator q = _asyncRequests.begin(); q != _asyncRequests.end(); ++q)
|
|
1997
2102
|
{
|
|
1998
|
-
if(q->second->
|
|
2103
|
+
if(q->second->exception(*_exception))
|
|
1999
2104
|
{
|
|
2000
|
-
q->second->
|
|
2105
|
+
q->second->invokeException();
|
|
2001
2106
|
}
|
|
2002
2107
|
}
|
|
2108
|
+
|
|
2003
2109
|
_asyncRequests.clear();
|
|
2004
2110
|
|
|
2005
2111
|
//
|
|
@@ -2010,12 +2116,14 @@ Ice::ConnectionI::finish(bool close)
|
|
|
2010
2116
|
_readStream.clear();
|
|
2011
2117
|
_readStream.b.clear();
|
|
2012
2118
|
|
|
2013
|
-
if(
|
|
2119
|
+
if(_closeCallback)
|
|
2014
2120
|
{
|
|
2015
|
-
closeCallback(
|
|
2016
|
-
|
|
2121
|
+
closeCallback(_closeCallback);
|
|
2122
|
+
_closeCallback = ICE_NULLPTR;
|
|
2017
2123
|
}
|
|
2018
2124
|
|
|
2125
|
+
_heartbeatCallback = ICE_NULLPTR;
|
|
2126
|
+
|
|
2019
2127
|
//
|
|
2020
2128
|
// This must be done last as this will cause waitUntilFinished() to return (and communicator
|
|
2021
2129
|
// objects such as the timer might be destroyed too).
|
|
@@ -2131,7 +2239,6 @@ Ice::ConnectionI::ConnectionI(const CommunicatorPtr& communicator,
|
|
|
2131
2239
|
_warnUdp(_instance->initializationData().properties->getPropertyAsInt("Ice.Warn.Datagrams") > 0),
|
|
2132
2240
|
_compressionLevel(1),
|
|
2133
2241
|
_nextRequestId(1),
|
|
2134
|
-
_requestsHint(_requests.end()),
|
|
2135
2242
|
_asyncRequestsHint(_asyncRequests.end()),
|
|
2136
2243
|
_messageSizeMax(adapter ? adapter->messageSizeMax() : _instance->messageSizeMax()),
|
|
2137
2244
|
_batchRequestQueue(new BatchRequestQueue(instance, endpoint->datagram())),
|
|
@@ -2166,36 +2273,39 @@ Ice::ConnectionI::ConnectionI(const CommunicatorPtr& communicator,
|
|
|
2166
2273
|
{
|
|
2167
2274
|
_acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic);
|
|
2168
2275
|
}
|
|
2276
|
+
}
|
|
2169
2277
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2278
|
+
Ice::ConnectionIPtr
|
|
2279
|
+
Ice::ConnectionI::create(const CommunicatorPtr& communicator,
|
|
2280
|
+
const InstancePtr& instance,
|
|
2281
|
+
const ACMMonitorPtr& monitor,
|
|
2282
|
+
const TransceiverPtr& transceiver,
|
|
2283
|
+
const ConnectorPtr& connector,
|
|
2284
|
+
const EndpointIPtr& endpoint,
|
|
2285
|
+
const ObjectAdapterIPtr& adapter)
|
|
2286
|
+
{
|
|
2287
|
+
Ice::ConnectionIPtr conn(new ConnectionI(communicator, instance, monitor, transceiver, connector,
|
|
2288
|
+
endpoint, adapter));
|
|
2289
|
+
if(adapter)
|
|
2172
2290
|
{
|
|
2173
|
-
|
|
2174
|
-
{
|
|
2175
|
-
const_cast<ThreadPoolPtr&>(_threadPool) = adapter->getThreadPool();
|
|
2176
|
-
}
|
|
2177
|
-
else
|
|
2178
|
-
{
|
|
2179
|
-
const_cast<ThreadPoolPtr&>(_threadPool) = _instance->clientThreadPool();
|
|
2180
|
-
}
|
|
2181
|
-
_threadPool->initialize(this);
|
|
2291
|
+
const_cast<ThreadPoolPtr&>(conn->_threadPool) = adapter->getThreadPool();
|
|
2182
2292
|
}
|
|
2183
|
-
|
|
2293
|
+
else
|
|
2184
2294
|
{
|
|
2185
|
-
|
|
2186
|
-
throw;
|
|
2295
|
+
const_cast<ThreadPoolPtr&>(conn->_threadPool) = conn->_instance->clientThreadPool();
|
|
2187
2296
|
}
|
|
2188
|
-
|
|
2297
|
+
conn->_threadPool->initialize(conn);
|
|
2298
|
+
return conn;
|
|
2189
2299
|
}
|
|
2190
2300
|
|
|
2191
2301
|
Ice::ConnectionI::~ConnectionI()
|
|
2192
2302
|
{
|
|
2193
2303
|
assert(!_startCallback);
|
|
2194
|
-
assert(!
|
|
2304
|
+
assert(!_closeCallback);
|
|
2305
|
+
assert(!_heartbeatCallback);
|
|
2195
2306
|
assert(_state == StateFinished);
|
|
2196
2307
|
assert(_dispatchCount == 0);
|
|
2197
2308
|
assert(_sendStreams.empty());
|
|
2198
|
-
assert(_requests.empty());
|
|
2199
2309
|
assert(_asyncRequests.empty());
|
|
2200
2310
|
}
|
|
2201
2311
|
|
|
@@ -2213,15 +2323,13 @@ Ice::ConnectionI::setState(State state, const LocalException& ex)
|
|
|
2213
2323
|
return;
|
|
2214
2324
|
}
|
|
2215
2325
|
|
|
2216
|
-
if(!_exception
|
|
2326
|
+
if(!_exception)
|
|
2217
2327
|
{
|
|
2218
2328
|
//
|
|
2219
2329
|
// If we are in closed state, an exception must be set.
|
|
2220
2330
|
//
|
|
2221
2331
|
assert(_state != StateClosed);
|
|
2222
|
-
|
|
2223
|
-
_exception.reset(ex.ice_clone());
|
|
2224
|
-
|
|
2332
|
+
ICE_SET_EXCEPTION_FROM_CLONE(_exception, ex.ice_clone());
|
|
2225
2333
|
//
|
|
2226
2334
|
// We don't warn if we are not validated.
|
|
2227
2335
|
//
|
|
@@ -2230,15 +2338,15 @@ Ice::ConnectionI::setState(State state, const LocalException& ex)
|
|
|
2230
2338
|
//
|
|
2231
2339
|
// Don't warn about certain expected exceptions.
|
|
2232
2340
|
//
|
|
2233
|
-
if(!(dynamic_cast<const CloseConnectionException*>(
|
|
2234
|
-
dynamic_cast<const
|
|
2235
|
-
dynamic_cast<const ConnectionTimeoutException*>(
|
|
2236
|
-
dynamic_cast<const CommunicatorDestroyedException*>(
|
|
2237
|
-
dynamic_cast<const ObjectAdapterDeactivatedException*>(
|
|
2238
|
-
(dynamic_cast<const ConnectionLostException*>(
|
|
2341
|
+
if(!(dynamic_cast<const CloseConnectionException*>(&ex) ||
|
|
2342
|
+
dynamic_cast<const ConnectionManuallyClosedException*>(&ex) ||
|
|
2343
|
+
dynamic_cast<const ConnectionTimeoutException*>(&ex) ||
|
|
2344
|
+
dynamic_cast<const CommunicatorDestroyedException*>(&ex) ||
|
|
2345
|
+
dynamic_cast<const ObjectAdapterDeactivatedException*>(&ex) ||
|
|
2346
|
+
(dynamic_cast<const ConnectionLostException*>(&ex) && _state >= StateClosing)))
|
|
2239
2347
|
{
|
|
2240
2348
|
Warning out(_logger);
|
|
2241
|
-
out << "connection exception:\n" <<
|
|
2349
|
+
out << "connection exception:\n" << ex << '\n' << _desc;
|
|
2242
2350
|
}
|
|
2243
2351
|
}
|
|
2244
2352
|
}
|
|
@@ -2280,92 +2388,92 @@ Ice::ConnectionI::setState(State state)
|
|
|
2280
2388
|
{
|
|
2281
2389
|
switch(state)
|
|
2282
2390
|
{
|
|
2283
|
-
|
|
2284
|
-
{
|
|
2285
|
-
assert(false);
|
|
2286
|
-
break;
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
case StateNotValidated:
|
|
2290
|
-
{
|
|
2291
|
-
if(_state != StateNotInitialized)
|
|
2391
|
+
case StateNotInitialized:
|
|
2292
2392
|
{
|
|
2293
|
-
assert(
|
|
2294
|
-
|
|
2393
|
+
assert(false);
|
|
2394
|
+
break;
|
|
2295
2395
|
}
|
|
2296
|
-
break;
|
|
2297
|
-
}
|
|
2298
2396
|
|
|
2299
|
-
|
|
2300
|
-
{
|
|
2301
|
-
//
|
|
2302
|
-
// Can only switch from holding or not validated to
|
|
2303
|
-
// active.
|
|
2304
|
-
//
|
|
2305
|
-
if(_state != StateHolding && _state != StateNotValidated)
|
|
2397
|
+
case StateNotValidated:
|
|
2306
2398
|
{
|
|
2307
|
-
|
|
2399
|
+
if(_state != StateNotInitialized)
|
|
2400
|
+
{
|
|
2401
|
+
assert(_state == StateClosed);
|
|
2402
|
+
return;
|
|
2403
|
+
}
|
|
2404
|
+
break;
|
|
2308
2405
|
}
|
|
2309
|
-
_threadPool->_register(this, SocketOperationRead);
|
|
2310
|
-
break;
|
|
2311
|
-
}
|
|
2312
2406
|
|
|
2313
|
-
|
|
2314
|
-
{
|
|
2315
|
-
//
|
|
2316
|
-
// Can only switch from active or not validated to
|
|
2317
|
-
// holding.
|
|
2318
|
-
//
|
|
2319
|
-
if(_state != StateActive && _state != StateNotValidated)
|
|
2407
|
+
case StateActive:
|
|
2320
2408
|
{
|
|
2321
|
-
|
|
2409
|
+
//
|
|
2410
|
+
// Can only switch from holding or not validated to
|
|
2411
|
+
// active.
|
|
2412
|
+
//
|
|
2413
|
+
if(_state != StateHolding && _state != StateNotValidated)
|
|
2414
|
+
{
|
|
2415
|
+
return;
|
|
2416
|
+
}
|
|
2417
|
+
_threadPool->_register(ICE_SHARED_FROM_THIS, SocketOperationRead);
|
|
2418
|
+
break;
|
|
2322
2419
|
}
|
|
2323
|
-
|
|
2420
|
+
|
|
2421
|
+
case StateHolding:
|
|
2324
2422
|
{
|
|
2325
|
-
|
|
2423
|
+
//
|
|
2424
|
+
// Can only switch from active or not validated to
|
|
2425
|
+
// holding.
|
|
2426
|
+
//
|
|
2427
|
+
if(_state != StateActive && _state != StateNotValidated)
|
|
2428
|
+
{
|
|
2429
|
+
return;
|
|
2430
|
+
}
|
|
2431
|
+
if(_state == StateActive)
|
|
2432
|
+
{
|
|
2433
|
+
_threadPool->unregister(ICE_SHARED_FROM_THIS, SocketOperationRead);
|
|
2434
|
+
}
|
|
2435
|
+
break;
|
|
2326
2436
|
}
|
|
2327
|
-
break;
|
|
2328
|
-
}
|
|
2329
2437
|
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
{
|
|
2333
|
-
//
|
|
2334
|
-
// Can't change back from closing pending.
|
|
2335
|
-
//
|
|
2336
|
-
if(_state >= StateClosingPending)
|
|
2438
|
+
case StateClosing:
|
|
2439
|
+
case StateClosingPending:
|
|
2337
2440
|
{
|
|
2338
|
-
|
|
2441
|
+
//
|
|
2442
|
+
// Can't change back from closing pending.
|
|
2443
|
+
//
|
|
2444
|
+
if(_state >= StateClosingPending)
|
|
2445
|
+
{
|
|
2446
|
+
return;
|
|
2447
|
+
}
|
|
2448
|
+
break;
|
|
2339
2449
|
}
|
|
2340
|
-
break;
|
|
2341
|
-
}
|
|
2342
2450
|
|
|
2343
|
-
|
|
2344
|
-
{
|
|
2345
|
-
if(_state == StateFinished)
|
|
2451
|
+
case StateClosed:
|
|
2346
2452
|
{
|
|
2347
|
-
|
|
2348
|
-
|
|
2453
|
+
if(_state == StateFinished)
|
|
2454
|
+
{
|
|
2455
|
+
return;
|
|
2456
|
+
}
|
|
2349
2457
|
|
|
2350
|
-
|
|
2458
|
+
_batchRequestQueue->destroy(*_exception);
|
|
2351
2459
|
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2460
|
+
//
|
|
2461
|
+
// Don't need to close now for connections so only close the transceiver
|
|
2462
|
+
// if the selector request it.
|
|
2463
|
+
//
|
|
2464
|
+
if(_threadPool->finish(ICE_SHARED_FROM_THIS, false))
|
|
2465
|
+
{
|
|
2466
|
+
_transceiver->close();
|
|
2467
|
+
}
|
|
2468
|
+
break;
|
|
2359
2469
|
}
|
|
2360
|
-
break;
|
|
2361
|
-
}
|
|
2362
2470
|
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2471
|
+
case StateFinished:
|
|
2472
|
+
{
|
|
2473
|
+
assert(_state == StateClosed);
|
|
2474
|
+
_communicator = 0;
|
|
2475
|
+
break;
|
|
2476
|
+
}
|
|
2369
2477
|
}
|
|
2370
2478
|
}
|
|
2371
2479
|
catch(const Ice::LocalException& ex)
|
|
@@ -2388,11 +2496,11 @@ Ice::ConnectionI::setState(State state)
|
|
|
2388
2496
|
{
|
|
2389
2497
|
_acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic);
|
|
2390
2498
|
}
|
|
2391
|
-
_monitor->add(
|
|
2499
|
+
_monitor->add(ICE_SHARED_FROM_THIS);
|
|
2392
2500
|
}
|
|
2393
2501
|
else if(_state == StateActive)
|
|
2394
2502
|
{
|
|
2395
|
-
_monitor->remove(
|
|
2503
|
+
_monitor->remove(ICE_SHARED_FROM_THIS);
|
|
2396
2504
|
}
|
|
2397
2505
|
}
|
|
2398
2506
|
|
|
@@ -2407,16 +2515,16 @@ Ice::ConnectionI::setState(State state)
|
|
|
2407
2515
|
newState,
|
|
2408
2516
|
_observer.get()));
|
|
2409
2517
|
}
|
|
2410
|
-
if(_observer && state == StateClosed && _exception
|
|
2518
|
+
if(_observer && state == StateClosed && _exception)
|
|
2411
2519
|
{
|
|
2412
2520
|
if(!(dynamic_cast<const CloseConnectionException*>(_exception.get()) ||
|
|
2413
|
-
dynamic_cast<const
|
|
2521
|
+
dynamic_cast<const ConnectionManuallyClosedException*>(_exception.get()) ||
|
|
2414
2522
|
dynamic_cast<const ConnectionTimeoutException*>(_exception.get()) ||
|
|
2415
2523
|
dynamic_cast<const CommunicatorDestroyedException*>(_exception.get()) ||
|
|
2416
2524
|
dynamic_cast<const ObjectAdapterDeactivatedException*>(_exception.get()) ||
|
|
2417
2525
|
(dynamic_cast<const ConnectionLostException*>(_exception.get()) && _state >= StateClosing)))
|
|
2418
2526
|
{
|
|
2419
|
-
_observer->failed(_exception->
|
|
2527
|
+
_observer->failed(_exception->ice_id());
|
|
2420
2528
|
}
|
|
2421
2529
|
}
|
|
2422
2530
|
}
|
|
@@ -2440,8 +2548,7 @@ Ice::ConnectionI::setState(State state)
|
|
|
2440
2548
|
void
|
|
2441
2549
|
Ice::ConnectionI::initiateShutdown()
|
|
2442
2550
|
{
|
|
2443
|
-
assert(_state == StateClosing);
|
|
2444
|
-
assert(_dispatchCount == 0);
|
|
2551
|
+
assert(_state == StateClosing && _dispatchCount == 0);
|
|
2445
2552
|
|
|
2446
2553
|
if(_shutdownInitiated)
|
|
2447
2554
|
{
|
|
@@ -2454,7 +2561,7 @@ Ice::ConnectionI::initiateShutdown()
|
|
|
2454
2561
|
//
|
|
2455
2562
|
// Before we shut down, we send a close connection message.
|
|
2456
2563
|
//
|
|
2457
|
-
|
|
2564
|
+
OutputStream os(_instance.get(), Ice::currentProtocolEncoding);
|
|
2458
2565
|
os.write(magic[0]);
|
|
2459
2566
|
os.write(magic[1]);
|
|
2460
2567
|
os.write(magic[2]);
|
|
@@ -2471,26 +2578,26 @@ Ice::ConnectionI::initiateShutdown()
|
|
|
2471
2578
|
setState(StateClosingPending);
|
|
2472
2579
|
|
|
2473
2580
|
//
|
|
2474
|
-
// Notify the
|
|
2581
|
+
// Notify the transceiver of the graceful connection closure.
|
|
2475
2582
|
//
|
|
2476
|
-
SocketOperation op = _transceiver->closing(true, *_exception
|
|
2583
|
+
SocketOperation op = _transceiver->closing(true, *_exception);
|
|
2477
2584
|
if(op)
|
|
2478
2585
|
{
|
|
2479
2586
|
scheduleTimeout(op);
|
|
2480
|
-
_threadPool->_register(
|
|
2587
|
+
_threadPool->_register(ICE_SHARED_FROM_THIS, op);
|
|
2481
2588
|
}
|
|
2482
2589
|
}
|
|
2483
2590
|
}
|
|
2484
2591
|
}
|
|
2485
2592
|
|
|
2486
2593
|
void
|
|
2487
|
-
Ice::ConnectionI::
|
|
2594
|
+
Ice::ConnectionI::sendHeartbeatNow()
|
|
2488
2595
|
{
|
|
2489
2596
|
assert(_state == StateActive);
|
|
2490
2597
|
|
|
2491
2598
|
if(!_endpoint->datagram())
|
|
2492
2599
|
{
|
|
2493
|
-
|
|
2600
|
+
OutputStream os(_instance.get(), Ice::currentProtocolEncoding);
|
|
2494
2601
|
os.write(magic[0]);
|
|
2495
2602
|
os.write(magic[1]);
|
|
2496
2603
|
os.write(magic[2]);
|
|
@@ -2509,7 +2616,7 @@ Ice::ConnectionI::heartbeat()
|
|
|
2509
2616
|
catch(const LocalException& ex)
|
|
2510
2617
|
{
|
|
2511
2618
|
setState(StateClosed, ex);
|
|
2512
|
-
assert(_exception
|
|
2619
|
+
assert(_exception);
|
|
2513
2620
|
}
|
|
2514
2621
|
}
|
|
2515
2622
|
}
|
|
@@ -2517,11 +2624,11 @@ Ice::ConnectionI::heartbeat()
|
|
|
2517
2624
|
bool
|
|
2518
2625
|
Ice::ConnectionI::initialize(SocketOperation operation)
|
|
2519
2626
|
{
|
|
2520
|
-
SocketOperation s = _transceiver->initialize(_readStream, _writeStream
|
|
2627
|
+
SocketOperation s = _transceiver->initialize(_readStream, _writeStream);
|
|
2521
2628
|
if(s != SocketOperationNone)
|
|
2522
2629
|
{
|
|
2523
2630
|
scheduleTimeout(s);
|
|
2524
|
-
_threadPool->update(
|
|
2631
|
+
_threadPool->update(ICE_SHARED_FROM_THIS, operation, s);
|
|
2525
2632
|
return false;
|
|
2526
2633
|
}
|
|
2527
2634
|
|
|
@@ -2567,7 +2674,7 @@ Ice::ConnectionI::validate(SocketOperation operation)
|
|
|
2567
2674
|
if(op)
|
|
2568
2675
|
{
|
|
2569
2676
|
scheduleTimeout(op);
|
|
2570
|
-
_threadPool->update(
|
|
2677
|
+
_threadPool->update(ICE_SHARED_FROM_THIS, operation, op);
|
|
2571
2678
|
return false;
|
|
2572
2679
|
}
|
|
2573
2680
|
}
|
|
@@ -2596,7 +2703,7 @@ Ice::ConnectionI::validate(SocketOperation operation)
|
|
|
2596
2703
|
if(op)
|
|
2597
2704
|
{
|
|
2598
2705
|
scheduleTimeout(op);
|
|
2599
|
-
_threadPool->update(
|
|
2706
|
+
_threadPool->update(ICE_SHARED_FROM_THIS, operation, op);
|
|
2600
2707
|
return false;
|
|
2601
2708
|
}
|
|
2602
2709
|
}
|
|
@@ -2740,17 +2847,10 @@ Ice::ConnectionI::sendNextMessage(vector<OutgoingMessage>& callbacks)
|
|
|
2740
2847
|
//
|
|
2741
2848
|
// Do compression.
|
|
2742
2849
|
//
|
|
2743
|
-
|
|
2850
|
+
OutputStream stream(_instance.get(), Ice::currentProtocolEncoding);
|
|
2744
2851
|
doCompress(*message->stream, stream);
|
|
2745
2852
|
|
|
2746
|
-
|
|
2747
|
-
{
|
|
2748
|
-
trace("sending asynchronous request", *message->stream, _logger, _traceLevels);
|
|
2749
|
-
}
|
|
2750
|
-
else
|
|
2751
|
-
{
|
|
2752
|
-
traceSend(*message->stream, _logger, _traceLevels);
|
|
2753
|
-
}
|
|
2853
|
+
traceSend(*message->stream, _logger, _traceLevels);
|
|
2754
2854
|
|
|
2755
2855
|
message->adopt(&stream); // Adopt the compressed stream.
|
|
2756
2856
|
message->stream->i = message->stream->b.begin();
|
|
@@ -2777,14 +2877,8 @@ Ice::ConnectionI::sendNextMessage(vector<OutgoingMessage>& callbacks)
|
|
|
2777
2877
|
copy(p, p + sizeof(Int), message->stream->b.begin() + 10);
|
|
2778
2878
|
#endif
|
|
2779
2879
|
message->stream->i = message->stream->b.begin();
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
trace("sending asynchronous request", *message->stream, _logger, _traceLevels);
|
|
2783
|
-
}
|
|
2784
|
-
else
|
|
2785
|
-
{
|
|
2786
|
-
traceSend(*message->stream, _logger, _traceLevels);
|
|
2787
|
-
}
|
|
2880
|
+
traceSend(*message->stream, _logger, _traceLevels);
|
|
2881
|
+
|
|
2788
2882
|
#ifdef ICE_HAS_BZIP2
|
|
2789
2883
|
}
|
|
2790
2884
|
#endif
|
|
@@ -2819,7 +2913,7 @@ Ice::ConnectionI::sendNextMessage(vector<OutgoingMessage>& callbacks)
|
|
|
2819
2913
|
if(_state == StateClosing && _shutdownInitiated)
|
|
2820
2914
|
{
|
|
2821
2915
|
setState(StateClosingPending);
|
|
2822
|
-
SocketOperation op = _transceiver->closing(true, *_exception
|
|
2916
|
+
SocketOperation op = _transceiver->closing(true, *_exception);
|
|
2823
2917
|
if(op)
|
|
2824
2918
|
{
|
|
2825
2919
|
return op;
|
|
@@ -2865,18 +2959,11 @@ Ice::ConnectionI::sendMessage(OutgoingMessage& message)
|
|
|
2865
2959
|
//
|
|
2866
2960
|
// Do compression.
|
|
2867
2961
|
//
|
|
2868
|
-
|
|
2962
|
+
OutputStream stream(_instance.get(), Ice::currentProtocolEncoding);
|
|
2869
2963
|
doCompress(*message.stream, stream);
|
|
2870
2964
|
stream.i = stream.b.begin();
|
|
2871
2965
|
|
|
2872
|
-
|
|
2873
|
-
{
|
|
2874
|
-
trace("sending asynchronous request", *message.stream, _logger, _traceLevels);
|
|
2875
|
-
}
|
|
2876
|
-
else
|
|
2877
|
-
{
|
|
2878
|
-
traceSend(*message.stream, _logger, _traceLevels);
|
|
2879
|
-
}
|
|
2966
|
+
traceSend(*message.stream, _logger, _traceLevels);
|
|
2880
2967
|
|
|
2881
2968
|
//
|
|
2882
2969
|
// Send the message without blocking.
|
|
@@ -2931,14 +3018,7 @@ Ice::ConnectionI::sendMessage(OutgoingMessage& message)
|
|
|
2931
3018
|
#endif
|
|
2932
3019
|
message.stream->i = message.stream->b.begin();
|
|
2933
3020
|
|
|
2934
|
-
|
|
2935
|
-
{
|
|
2936
|
-
trace("sending asynchronous request", *message.stream, _logger, _traceLevels);
|
|
2937
|
-
}
|
|
2938
|
-
else
|
|
2939
|
-
{
|
|
2940
|
-
traceSend(*message.stream, _logger, _traceLevels);
|
|
2941
|
-
}
|
|
3021
|
+
traceSend(*message.stream, _logger, _traceLevels);
|
|
2942
3022
|
|
|
2943
3023
|
//
|
|
2944
3024
|
// Send the message without blocking.
|
|
@@ -2974,7 +3054,7 @@ Ice::ConnectionI::sendMessage(OutgoingMessage& message)
|
|
|
2974
3054
|
|
|
2975
3055
|
_writeStream.swap(*_sendStreams.back().stream);
|
|
2976
3056
|
scheduleTimeout(op);
|
|
2977
|
-
_threadPool->_register(
|
|
3057
|
+
_threadPool->_register(ICE_SHARED_FROM_THIS, op);
|
|
2978
3058
|
return AsyncStatusQueued;
|
|
2979
3059
|
}
|
|
2980
3060
|
|
|
@@ -3041,7 +3121,7 @@ getBZ2Error(int bzError)
|
|
|
3041
3121
|
}
|
|
3042
3122
|
|
|
3043
3123
|
void
|
|
3044
|
-
Ice::ConnectionI::doCompress(
|
|
3124
|
+
Ice::ConnectionI::doCompress(OutputStream& uncompressed, OutputStream& compressed)
|
|
3045
3125
|
{
|
|
3046
3126
|
const Byte* p;
|
|
3047
3127
|
|
|
@@ -3096,7 +3176,7 @@ Ice::ConnectionI::doCompress(BasicStream& uncompressed, BasicStream& compressed)
|
|
|
3096
3176
|
}
|
|
3097
3177
|
|
|
3098
3178
|
void
|
|
3099
|
-
Ice::ConnectionI::doUncompress(
|
|
3179
|
+
Ice::ConnectionI::doUncompress(InputStream& compressed, InputStream& uncompressed)
|
|
3100
3180
|
{
|
|
3101
3181
|
Int uncompressedSize;
|
|
3102
3182
|
compressed.i = compressed.b.begin() + headerSize;
|
|
@@ -3131,9 +3211,9 @@ Ice::ConnectionI::doUncompress(BasicStream& compressed, BasicStream& uncompresse
|
|
|
3131
3211
|
#endif
|
|
3132
3212
|
|
|
3133
3213
|
SocketOperation
|
|
3134
|
-
Ice::ConnectionI::parseMessage(
|
|
3214
|
+
Ice::ConnectionI::parseMessage(InputStream& stream, Int& invokeNum, Int& requestId, Byte& compress,
|
|
3135
3215
|
ServantManagerPtr& servantManager, ObjectAdapterPtr& adapter,
|
|
3136
|
-
OutgoingAsyncBasePtr& outAsync,
|
|
3216
|
+
OutgoingAsyncBasePtr& outAsync, ICE_DELEGATE(HeartbeatCallback)& heartbeatCallback,
|
|
3137
3217
|
int& dispatchCount)
|
|
3138
3218
|
{
|
|
3139
3219
|
assert(_state > StateNotValidated && _state < StateClosed);
|
|
@@ -3169,7 +3249,7 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3169
3249
|
if(compress == 2)
|
|
3170
3250
|
{
|
|
3171
3251
|
#ifdef ICE_HAS_BZIP2
|
|
3172
|
-
|
|
3252
|
+
InputStream ustream(_instance.get(), Ice::currentProtocolEncoding);
|
|
3173
3253
|
doUncompress(stream, ustream);
|
|
3174
3254
|
stream.b.swap(ustream.b);
|
|
3175
3255
|
#else
|
|
@@ -3198,9 +3278,9 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3198
3278
|
setState(StateClosingPending, CloseConnectionException(__FILE__, __LINE__));
|
|
3199
3279
|
|
|
3200
3280
|
//
|
|
3201
|
-
// Notify the
|
|
3281
|
+
// Notify the transceiver of the graceful connection closure.
|
|
3202
3282
|
//
|
|
3203
|
-
SocketOperation op = _transceiver->closing(false, *_exception
|
|
3283
|
+
SocketOperation op = _transceiver->closing(false, *_exception);
|
|
3204
3284
|
if(op)
|
|
3205
3285
|
{
|
|
3206
3286
|
return op;
|
|
@@ -3258,54 +3338,22 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3258
3338
|
|
|
3259
3339
|
stream.read(requestId);
|
|
3260
3340
|
|
|
3261
|
-
map<Int, OutgoingBase*>::iterator p = _requests.end();
|
|
3262
3341
|
map<Int, OutgoingAsyncBasePtr>::iterator q = _asyncRequests.end();
|
|
3263
3342
|
|
|
3264
|
-
if(
|
|
3265
|
-
{
|
|
3266
|
-
if(_requestsHint->first == requestId)
|
|
3267
|
-
{
|
|
3268
|
-
p = _requestsHint;
|
|
3269
|
-
}
|
|
3270
|
-
}
|
|
3271
|
-
|
|
3272
|
-
if(p == _requests.end())
|
|
3343
|
+
if(_asyncRequestsHint != _asyncRequests.end())
|
|
3273
3344
|
{
|
|
3274
|
-
if(_asyncRequestsHint
|
|
3345
|
+
if(_asyncRequestsHint->first == requestId)
|
|
3275
3346
|
{
|
|
3276
|
-
|
|
3277
|
-
{
|
|
3278
|
-
q = _asyncRequestsHint;
|
|
3279
|
-
}
|
|
3347
|
+
q = _asyncRequestsHint;
|
|
3280
3348
|
}
|
|
3281
3349
|
}
|
|
3282
3350
|
|
|
3283
|
-
if(
|
|
3284
|
-
{
|
|
3285
|
-
p = _requests.find(requestId);
|
|
3286
|
-
}
|
|
3287
|
-
|
|
3288
|
-
if(p == _requests.end() && q == _asyncRequests.end())
|
|
3351
|
+
if(q == _asyncRequests.end())
|
|
3289
3352
|
{
|
|
3290
3353
|
q = _asyncRequests.find(requestId);
|
|
3291
3354
|
}
|
|
3292
3355
|
|
|
3293
|
-
if(
|
|
3294
|
-
{
|
|
3295
|
-
p->second->completed(stream);
|
|
3296
|
-
|
|
3297
|
-
if(p == _requestsHint)
|
|
3298
|
-
{
|
|
3299
|
-
_requests.erase(p++);
|
|
3300
|
-
_requestsHint = p;
|
|
3301
|
-
}
|
|
3302
|
-
else
|
|
3303
|
-
{
|
|
3304
|
-
_requests.erase(p);
|
|
3305
|
-
}
|
|
3306
|
-
notifyAll(); // Notify threads blocked in close(false)
|
|
3307
|
-
}
|
|
3308
|
-
else if(q != _asyncRequests.end())
|
|
3356
|
+
if(q != _asyncRequests.end())
|
|
3309
3357
|
{
|
|
3310
3358
|
outAsync = q->second;
|
|
3311
3359
|
|
|
@@ -3321,7 +3369,7 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3321
3369
|
|
|
3322
3370
|
stream.swap(*outAsync->getIs());
|
|
3323
3371
|
|
|
3324
|
-
#if defined(ICE_USE_IOCP) || defined(
|
|
3372
|
+
#if defined(ICE_USE_IOCP) || defined(ICE_OS_UWP)
|
|
3325
3373
|
//
|
|
3326
3374
|
// If we just received the reply of a request which isn't acknowledge as
|
|
3327
3375
|
// sent yet, we queue the reply instead of processing it right away. It
|
|
@@ -3333,7 +3381,7 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3333
3381
|
message->receivedReply = true;
|
|
3334
3382
|
outAsync = 0;
|
|
3335
3383
|
}
|
|
3336
|
-
else if(outAsync->
|
|
3384
|
+
else if(outAsync->response())
|
|
3337
3385
|
{
|
|
3338
3386
|
++dispatchCount;
|
|
3339
3387
|
}
|
|
@@ -3342,7 +3390,7 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3342
3390
|
outAsync = 0;
|
|
3343
3391
|
}
|
|
3344
3392
|
#else
|
|
3345
|
-
if(outAsync->
|
|
3393
|
+
if(outAsync->response())
|
|
3346
3394
|
{
|
|
3347
3395
|
++dispatchCount;
|
|
3348
3396
|
}
|
|
@@ -3360,9 +3408,9 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3360
3408
|
case validateConnectionMsg:
|
|
3361
3409
|
{
|
|
3362
3410
|
traceRecv(stream, _logger, _traceLevels);
|
|
3363
|
-
if(
|
|
3411
|
+
if(_heartbeatCallback)
|
|
3364
3412
|
{
|
|
3365
|
-
heartbeatCallback =
|
|
3413
|
+
heartbeatCallback = _heartbeatCallback;
|
|
3366
3414
|
++dispatchCount;
|
|
3367
3415
|
}
|
|
3368
3416
|
break;
|
|
@@ -3395,7 +3443,7 @@ Ice::ConnectionI::parseMessage(BasicStream& stream, Int& invokeNum, Int& request
|
|
|
3395
3443
|
}
|
|
3396
3444
|
|
|
3397
3445
|
void
|
|
3398
|
-
Ice::ConnectionI::invokeAll(
|
|
3446
|
+
Ice::ConnectionI::invokeAll(InputStream& stream, Int invokeNum, Int requestId, Byte compress,
|
|
3399
3447
|
const ServantManagerPtr& servantManager, const ObjectAdapterPtr& adapter)
|
|
3400
3448
|
{
|
|
3401
3449
|
//
|
|
@@ -3530,11 +3578,17 @@ Ice::ConnectionI::initConnectionInfo() const
|
|
|
3530
3578
|
}
|
|
3531
3579
|
catch(const Ice::LocalException&)
|
|
3532
3580
|
{
|
|
3533
|
-
_info =
|
|
3581
|
+
_info = ICE_MAKE_SHARED(ConnectionInfo);
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
Ice::ConnectionInfoPtr info = _info;
|
|
3585
|
+
while(info)
|
|
3586
|
+
{
|
|
3587
|
+
info->connectionId = _endpoint->connectionId();
|
|
3588
|
+
info->incoming = _connector == 0;
|
|
3589
|
+
info->adapterName = _adapter ? _adapter->getName() : string();
|
|
3590
|
+
info = info->underlying;
|
|
3534
3591
|
}
|
|
3535
|
-
_info->connectionId = _endpoint->connectionId();
|
|
3536
|
-
_info->incoming = _connector == 0;
|
|
3537
|
-
_info->adapterName = _adapter ? _adapter->getName() : string();
|
|
3538
3592
|
return _info;
|
|
3539
3593
|
}
|
|
3540
3594
|
|
|
@@ -3548,7 +3602,7 @@ SocketOperation
|
|
|
3548
3602
|
ConnectionI::read(Buffer& buf)
|
|
3549
3603
|
{
|
|
3550
3604
|
Buffer::Container::iterator start = buf.i;
|
|
3551
|
-
SocketOperation op = _transceiver->read(buf
|
|
3605
|
+
SocketOperation op = _transceiver->read(buf);
|
|
3552
3606
|
if(_instance->traceLevels()->network >= 3 && buf.i != start)
|
|
3553
3607
|
{
|
|
3554
3608
|
Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
|
|
@@ -3589,7 +3643,7 @@ ConnectionI::reap()
|
|
|
3589
3643
|
{
|
|
3590
3644
|
if(_monitor)
|
|
3591
3645
|
{
|
|
3592
|
-
_monitor->reap(
|
|
3646
|
+
_monitor->reap(ICE_SHARED_FROM_THIS);
|
|
3593
3647
|
}
|
|
3594
3648
|
if(_observer)
|
|
3595
3649
|
{
|