zeroc-ice 3.7.9.1 → 3.8.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.
Files changed (1215) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Communicator.cpp +575 -0
  3. data/dist/IceRuby/Communicator.h +19 -0
  4. data/dist/IceRuby/Config.h +77 -0
  5. data/dist/IceRuby/Connection.cpp +428 -0
  6. data/dist/IceRuby/Connection.h +20 -0
  7. data/dist/IceRuby/DefaultSliceLoader.cpp +45 -0
  8. data/dist/IceRuby/DefaultSliceLoader.h +25 -0
  9. data/dist/IceRuby/Endpoint.cpp +342 -0
  10. data/dist/IceRuby/Endpoint.h +18 -0
  11. data/dist/IceRuby/ImplicitContext.cpp +143 -0
  12. data/dist/IceRuby/ImplicitContext.h +16 -0
  13. data/dist/IceRuby/Init.cpp +36 -0
  14. data/dist/IceRuby/Logger.cpp +146 -0
  15. data/dist/IceRuby/Logger.h +19 -0
  16. data/dist/IceRuby/Operation.cpp +623 -0
  17. data/dist/IceRuby/Operation.h +28 -0
  18. data/dist/IceRuby/Properties.cpp +413 -0
  19. data/dist/IceRuby/Properties.h +16 -0
  20. data/dist/IceRuby/Proxy.cpp +926 -0
  21. data/dist/IceRuby/Proxy.h +21 -0
  22. data/dist/IceRuby/RubySliceLoader.cpp +39 -0
  23. data/dist/IceRuby/RubySliceLoader.h +27 -0
  24. data/dist/IceRuby/Slice.cpp +199 -0
  25. data/dist/IceRuby/Slice.h +13 -0
  26. data/dist/IceRuby/Types.cpp +3133 -0
  27. data/dist/IceRuby/Types.h +533 -0
  28. data/dist/IceRuby/Util.cpp +553 -0
  29. data/dist/IceRuby/Util.h +485 -0
  30. data/dist/ice/cpp/include/Ice/AsyncResponseHandler.h +85 -0
  31. data/dist/ice/cpp/include/Ice/BatchRequest.h +39 -0
  32. data/dist/ice/cpp/include/Ice/BatchRequestQueueF.h +14 -0
  33. data/dist/ice/cpp/include/Ice/Buffer.h +159 -0
  34. data/dist/ice/cpp/include/Ice/Communicator.h +411 -0
  35. data/dist/ice/cpp/include/Ice/CommunicatorF.h +16 -0
  36. data/dist/ice/cpp/include/Ice/Config.h +60 -0
  37. data/dist/ice/cpp/include/Ice/Connection.h +410 -0
  38. data/dist/ice/cpp/include/Ice/ConnectionF.h +36 -0
  39. data/dist/ice/cpp/include/Ice/ConnectionIF.h +16 -0
  40. data/dist/ice/cpp/include/Ice/CtrlCHandler.h +56 -0
  41. data/dist/ice/cpp/include/Ice/Current.h +60 -0
  42. data/dist/ice/cpp/include/Ice/DefaultSliceLoader.h +160 -0
  43. data/dist/ice/cpp/include/Ice/Demangle.h +17 -0
  44. data/dist/ice/cpp/include/Ice/Endpoint.h +298 -0
  45. data/dist/ice/cpp/include/Ice/EndpointF.h +44 -0
  46. data/dist/ice/cpp/include/Ice/EndpointSelectionType.h +21 -0
  47. data/dist/ice/cpp/include/Ice/Exception.h +56 -0
  48. data/dist/ice/cpp/include/Ice/FacetMap.h +16 -0
  49. data/dist/ice/cpp/include/Ice/Format.h +22 -0
  50. data/dist/ice/cpp/include/Ice/Ice.h +60 -0
  51. data/dist/ice/cpp/include/Ice/IconvStringConverter.h +216 -0
  52. data/dist/ice/cpp/include/Ice/ImplicitContext.h +76 -0
  53. data/dist/ice/cpp/include/Ice/IncomingRequest.h +75 -0
  54. data/dist/ice/cpp/include/Ice/Initialize.h +143 -0
  55. data/dist/ice/cpp/include/Ice/InputStream.h +942 -0
  56. data/dist/ice/cpp/include/Ice/InstanceF.h +14 -0
  57. data/dist/ice/cpp/include/Ice/Instrumentation.h +319 -0
  58. data/dist/ice/cpp/include/Ice/LocalException.h +58 -0
  59. data/dist/ice/cpp/include/Ice/LocalExceptions.h +870 -0
  60. data/dist/ice/cpp/include/Ice/Logger.h +62 -0
  61. data/dist/ice/cpp/include/Ice/LoggerUtil.h +162 -0
  62. data/dist/ice/cpp/include/Ice/MarshaledResult.h +50 -0
  63. data/dist/ice/cpp/include/Ice/NativePropertiesAdmin.h +54 -0
  64. data/dist/ice/cpp/include/Ice/Object.h +168 -0
  65. data/dist/ice/cpp/include/Ice/ObjectAdapter.h +324 -0
  66. data/dist/ice/cpp/include/Ice/ObjectAdapterF.h +16 -0
  67. data/dist/ice/cpp/include/Ice/ObjectF.h +16 -0
  68. data/dist/ice/cpp/include/Ice/ObserverHelper.h +164 -0
  69. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +512 -0
  70. data/dist/ice/cpp/include/Ice/OutgoingResponse.h +129 -0
  71. data/dist/ice/cpp/include/Ice/OutputStream.h +872 -0
  72. data/dist/ice/cpp/include/Ice/Plugin.h +73 -0
  73. data/dist/ice/cpp/include/Ice/PluginFactory.h +77 -0
  74. data/dist/ice/cpp/include/Ice/PopDisableWarnings.h +16 -0
  75. data/dist/ice/cpp/include/Ice/Properties.h +307 -0
  76. data/dist/ice/cpp/include/Ice/PropertiesF.h +19 -0
  77. data/dist/ice/cpp/include/Ice/Proxy.h +742 -0
  78. data/dist/ice/cpp/include/Ice/ProxyF.h +11 -0
  79. data/dist/ice/cpp/include/Ice/ProxyFunctions.h +209 -0
  80. data/dist/ice/cpp/include/Ice/PushDisableWarnings.h +29 -0
  81. data/dist/ice/cpp/include/Ice/ReferenceF.h +14 -0
  82. data/dist/ice/cpp/include/Ice/RequestHandlerF.h +20 -0
  83. data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +268 -0
  84. data/dist/ice/cpp/include/Ice/SSL/Config.h +54 -0
  85. data/dist/ice/cpp/include/Ice/SSL/ConnectionInfo.h +107 -0
  86. data/dist/ice/cpp/include/Ice/SSL/ConnectionInfoF.h +39 -0
  87. data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +40 -0
  88. data/dist/ice/cpp/include/Ice/SSL/SSLException.h +32 -0
  89. data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +278 -0
  90. data/dist/ice/cpp/include/Ice/ServantLocator.h +51 -0
  91. data/dist/ice/cpp/include/Ice/Service.h +219 -0
  92. data/dist/ice/cpp/include/Ice/SliceLoader.h +67 -0
  93. data/dist/ice/cpp/include/Ice/SlicedData.h +125 -0
  94. data/dist/ice/cpp/include/Ice/SlicedDataF.h +30 -0
  95. data/dist/ice/cpp/include/Ice/StreamHelpers.h +652 -0
  96. data/dist/ice/cpp/include/Ice/StreamableTraits.h +291 -0
  97. data/dist/ice/cpp/include/Ice/StringConverter.h +167 -0
  98. data/dist/ice/cpp/include/Ice/StringUtil.h +114 -0
  99. data/dist/ice/cpp/include/Ice/TimerTask.h +24 -0
  100. data/dist/ice/cpp/include/Ice/TupleCompare.h +103 -0
  101. data/dist/ice/cpp/include/Ice/UUID.h +16 -0
  102. data/dist/ice/cpp/include/Ice/UserException.h +46 -0
  103. data/dist/ice/cpp/include/Ice/UserExceptionFactory.h +15 -0
  104. data/dist/ice/cpp/include/Ice/Value.h +127 -0
  105. data/dist/ice/cpp/include/Ice/ValueF.h +16 -0
  106. data/dist/ice/cpp/include/IceDiscovery/IceDiscovery.h +28 -0
  107. data/dist/ice/cpp/include/IceLocatorDiscovery/IceLocatorDiscovery.h +28 -0
  108. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +70 -0
  109. data/dist/ice/cpp/include/generated/Ice/Context.h +40 -0
  110. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +74 -0
  111. data/dist/ice/cpp/include/generated/Ice/Identity.h +108 -0
  112. data/dist/ice/cpp/include/generated/Ice/Locator.h +542 -0
  113. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +443 -0
  114. data/dist/ice/cpp/include/generated/Ice/Metrics.h +1103 -0
  115. data/dist/ice/cpp/include/generated/Ice/OperationMode.h +73 -0
  116. data/dist/ice/cpp/include/generated/Ice/Process.h +245 -0
  117. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +314 -0
  118. data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +39 -0
  119. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +724 -0
  120. data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +94 -0
  121. data/dist/ice/cpp/include/generated/Ice/Router.h +496 -0
  122. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +37 -0
  123. data/dist/ice/cpp/include/generated/Ice/Version.h +112 -0
  124. data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +498 -0
  125. data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +387 -0
  126. data/dist/ice/cpp/src/Ice/Acceptor.h +41 -0
  127. data/dist/ice/cpp/src/Ice/AcceptorF.h +17 -0
  128. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories.h +16 -0
  129. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +43 -0
  130. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_min.cpp +17 -0
  131. data/dist/ice/cpp/src/Ice/ArgVector.cpp +58 -0
  132. data/dist/ice/cpp/src/Ice/ArgVector.h +30 -0
  133. data/dist/ice/cpp/src/Ice/Base64.cpp +263 -0
  134. data/dist/ice/cpp/src/Ice/Base64.h +26 -0
  135. data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +199 -0
  136. data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +49 -0
  137. data/dist/ice/cpp/src/Ice/Buffer.cpp +187 -0
  138. data/dist/ice/cpp/src/Ice/CheckIdentity.h +21 -0
  139. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +373 -0
  140. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +65 -0
  141. data/dist/ice/cpp/src/Ice/Communicator.cpp +399 -0
  142. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +140 -0
  143. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.h +39 -0
  144. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +227 -0
  145. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +51 -0
  146. data/dist/ice/cpp/src/Ice/ConnectRequestHandlerF.h +14 -0
  147. data/dist/ice/cpp/src/Ice/Connection.cpp +44 -0
  148. data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +1758 -0
  149. data/dist/ice/cpp/src/Ice/ConnectionFactory.h +264 -0
  150. data/dist/ice/cpp/src/Ice/ConnectionFactoryF.h +17 -0
  151. data/dist/ice/cpp/src/Ice/ConnectionI.cpp +3563 -0
  152. data/dist/ice/cpp/src/Ice/ConnectionI.h +429 -0
  153. data/dist/ice/cpp/src/Ice/ConnectionOptions.h +22 -0
  154. data/dist/ice/cpp/src/Ice/Connector.h +38 -0
  155. data/dist/ice/cpp/src/Ice/ConnectorF.h +14 -0
  156. data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +136 -0
  157. data/dist/ice/cpp/src/Ice/ConsoleUtil.h +79 -0
  158. data/dist/ice/cpp/src/Ice/CtrlCHandler.cpp +189 -0
  159. data/dist/ice/cpp/src/Ice/Current.cpp +29 -0
  160. data/dist/ice/cpp/src/Ice/DLLMain.cpp +40 -0
  161. data/dist/ice/cpp/src/Ice/DefaultSliceLoader.cpp +39 -0
  162. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +81 -0
  163. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.h +38 -0
  164. data/dist/ice/cpp/src/Ice/DefaultsAndOverridesF.h +14 -0
  165. data/dist/ice/cpp/src/Ice/Demangle.cpp +25 -0
  166. data/dist/ice/cpp/src/Ice/DisableWarnings.h +31 -0
  167. data/dist/ice/cpp/src/Ice/DynamicLibrary.cpp +216 -0
  168. data/dist/ice/cpp/src/Ice/DynamicLibrary.h +91 -0
  169. data/dist/ice/cpp/src/Ice/Endian.h +40 -0
  170. data/dist/ice/cpp/src/Ice/EndpointFactory.cpp +165 -0
  171. data/dist/ice/cpp/src/Ice/EndpointFactory.h +96 -0
  172. data/dist/ice/cpp/src/Ice/EndpointFactoryF.h +14 -0
  173. data/dist/ice/cpp/src/Ice/EndpointFactoryManager.cpp +180 -0
  174. data/dist/ice/cpp/src/Ice/EndpointFactoryManager.h +42 -0
  175. data/dist/ice/cpp/src/Ice/EndpointFactoryManagerF.h +14 -0
  176. data/dist/ice/cpp/src/Ice/EndpointI.cpp +128 -0
  177. data/dist/ice/cpp/src/Ice/EndpointI.h +150 -0
  178. data/dist/ice/cpp/src/Ice/EndpointIF.h +21 -0
  179. data/dist/ice/cpp/src/Ice/EventHandler.cpp +9 -0
  180. data/dist/ice/cpp/src/Ice/EventHandler.h +71 -0
  181. data/dist/ice/cpp/src/Ice/EventHandlerF.h +14 -0
  182. data/dist/ice/cpp/src/Ice/Exception.cpp +5 -0
  183. data/dist/ice/cpp/src/Ice/FileUtil.cpp +476 -0
  184. data/dist/ice/cpp/src/Ice/FileUtil.h +152 -0
  185. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +34 -0
  186. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +29 -0
  187. data/dist/ice/cpp/src/Ice/HashUtil.h +67 -0
  188. data/dist/ice/cpp/src/Ice/HttpParser.cpp +684 -0
  189. data/dist/ice/cpp/src/Ice/HttpParser.h +112 -0
  190. data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +593 -0
  191. data/dist/ice/cpp/src/Ice/IPEndpointI.h +106 -0
  192. data/dist/ice/cpp/src/Ice/IPEndpointIF.h +17 -0
  193. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +172 -0
  194. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +89 -0
  195. data/dist/ice/cpp/src/Ice/ImplicitContext.cpp +109 -0
  196. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +66 -0
  197. data/dist/ice/cpp/src/Ice/Initialize.cpp +160 -0
  198. data/dist/ice/cpp/src/Ice/InputStream.cpp +2206 -0
  199. data/dist/ice/cpp/src/Ice/Instance.cpp +1956 -0
  200. data/dist/ice/cpp/src/Ice/Instance.h +225 -0
  201. data/dist/ice/cpp/src/Ice/InstrumentationI.cpp +959 -0
  202. data/dist/ice/cpp/src/Ice/InstrumentationI.h +235 -0
  203. data/dist/ice/cpp/src/Ice/LocalException.cpp +518 -0
  204. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +577 -0
  205. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +851 -0
  206. data/dist/ice/cpp/src/Ice/LocatorInfo.h +176 -0
  207. data/dist/ice/cpp/src/Ice/LocatorInfoF.h +20 -0
  208. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +774 -0
  209. data/dist/ice/cpp/src/Ice/LoggerAdminI.h +31 -0
  210. data/dist/ice/cpp/src/Ice/LoggerI.cpp +234 -0
  211. data/dist/ice/cpp/src/Ice/LoggerI.h +47 -0
  212. data/dist/ice/cpp/src/Ice/LoggerMiddleware.cpp +176 -0
  213. data/dist/ice/cpp/src/Ice/LoggerMiddleware.h +42 -0
  214. data/dist/ice/cpp/src/Ice/LoggerUtil.cpp +76 -0
  215. data/dist/ice/cpp/src/Ice/MarshaledResult.cpp +20 -0
  216. data/dist/ice/cpp/src/Ice/MetricsAdminI.cpp +608 -0
  217. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +600 -0
  218. data/dist/ice/cpp/src/Ice/MetricsFunctional.h +92 -0
  219. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +587 -0
  220. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +185 -0
  221. data/dist/ice/cpp/src/Ice/Network.cpp +1927 -0
  222. data/dist/ice/cpp/src/Ice/Network.h +265 -0
  223. data/dist/ice/cpp/src/Ice/NetworkF.h +11 -0
  224. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +306 -0
  225. data/dist/ice/cpp/src/Ice/NetworkProxy.h +67 -0
  226. data/dist/ice/cpp/src/Ice/NetworkProxyF.h +14 -0
  227. data/dist/ice/cpp/src/Ice/OSLogLoggerI.cpp +55 -0
  228. data/dist/ice/cpp/src/Ice/OSLogLoggerI.h +35 -0
  229. data/dist/ice/cpp/src/Ice/Object.cpp +249 -0
  230. data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +348 -0
  231. data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.h +53 -0
  232. data/dist/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +14 -0
  233. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +1383 -0
  234. data/dist/ice/cpp/src/Ice/ObjectAdapterI.h +163 -0
  235. data/dist/ice/cpp/src/Ice/ObserverHelper.cpp +75 -0
  236. data/dist/ice/cpp/src/Ice/ObserverMiddleware.cpp +96 -0
  237. data/dist/ice/cpp/src/Ice/ObserverMiddleware.h +25 -0
  238. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +368 -0
  239. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.h +66 -0
  240. data/dist/ice/cpp/src/Ice/Options.cpp +980 -0
  241. data/dist/ice/cpp/src/Ice/Options.h +119 -0
  242. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1106 -0
  243. data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +276 -0
  244. data/dist/ice/cpp/src/Ice/OutputStream.cpp +1454 -0
  245. data/dist/ice/cpp/src/Ice/OutputUtil.cpp +344 -0
  246. data/dist/ice/cpp/src/Ice/OutputUtil.h +173 -0
  247. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +344 -0
  248. data/dist/ice/cpp/src/Ice/PluginManagerI.h +54 -0
  249. data/dist/ice/cpp/src/Ice/Properties.cpp +931 -0
  250. data/dist/ice/cpp/src/Ice/PropertyNames.cpp +606 -0
  251. data/dist/ice/cpp/src/Ice/PropertyNames.h +63 -0
  252. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +103 -0
  253. data/dist/ice/cpp/src/Ice/PropertyUtil.h +31 -0
  254. data/dist/ice/cpp/src/Ice/Protocol.cpp +159 -0
  255. data/dist/ice/cpp/src/Ice/Protocol.h +116 -0
  256. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +186 -0
  257. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +74 -0
  258. data/dist/ice/cpp/src/Ice/ProtocolInstanceF.h +14 -0
  259. data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +29 -0
  260. data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.h +35 -0
  261. data/dist/ice/cpp/src/Ice/Proxy.cpp +541 -0
  262. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +684 -0
  263. data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +90 -0
  264. data/dist/ice/cpp/src/Ice/PushDisableDeprecatedWarnings.h +15 -0
  265. data/dist/ice/cpp/src/Ice/Random.cpp +29 -0
  266. data/dist/ice/cpp/src/Ice/Random.h +23 -0
  267. data/dist/ice/cpp/src/Ice/Reference.cpp +1584 -0
  268. data/dist/ice/cpp/src/Ice/Reference.h +339 -0
  269. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +830 -0
  270. data/dist/ice/cpp/src/Ice/ReferenceFactory.h +58 -0
  271. data/dist/ice/cpp/src/Ice/ReferenceFactoryF.h +14 -0
  272. data/dist/ice/cpp/src/Ice/RequestHandler.cpp +28 -0
  273. data/dist/ice/cpp/src/Ice/RequestHandler.h +53 -0
  274. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +76 -0
  275. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +33 -0
  276. data/dist/ice/cpp/src/Ice/ResourceConfig.h +27 -0
  277. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +151 -0
  278. data/dist/ice/cpp/src/Ice/RetryQueue.h +59 -0
  279. data/dist/ice/cpp/src/Ice/RetryQueueF.h +14 -0
  280. data/dist/ice/cpp/src/Ice/RouterInfo.cpp +275 -0
  281. data/dist/ice/cpp/src/Ice/RouterInfo.h +95 -0
  282. data/dist/ice/cpp/src/Ice/RouterInfoF.h +17 -0
  283. data/dist/ice/cpp/src/Ice/SHA1.cpp +195 -0
  284. data/dist/ice/cpp/src/Ice/SHA1.h +35 -0
  285. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +89 -0
  286. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +87 -0
  287. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +513 -0
  288. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +40 -0
  289. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngineF.h +13 -0
  290. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +635 -0
  291. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +80 -0
  292. data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +487 -0
  293. data/dist/ice/cpp/src/Ice/SSL/RFC2253.h +58 -0
  294. data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.cpp +124 -0
  295. data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.h +52 -0
  296. data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.cpp +92 -0
  297. data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.h +38 -0
  298. data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +377 -0
  299. data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.h +84 -0
  300. data/dist/ice/cpp/src/Ice/SSL/SSLEngine.cpp +115 -0
  301. data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +72 -0
  302. data/dist/ice/cpp/src/Ice/SSL/SSLEngineF.h +14 -0
  303. data/dist/ice/cpp/src/Ice/SSL/SSLException.cpp +18 -0
  304. data/dist/ice/cpp/src/Ice/SSL/SSLInstance.cpp +27 -0
  305. data/dist/ice/cpp/src/Ice/SSL/SSLInstance.h +26 -0
  306. data/dist/ice/cpp/src/Ice/SSL/SSLInstanceF.h +19 -0
  307. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +654 -0
  308. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.h +104 -0
  309. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +1437 -0
  310. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +58 -0
  311. data/dist/ice/cpp/src/Ice/SSL/SchannelEngineF.h +18 -0
  312. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +1085 -0
  313. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +118 -0
  314. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +822 -0
  315. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +44 -0
  316. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngineF.h +18 -0
  317. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +621 -0
  318. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.h +91 -0
  319. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +1061 -0
  320. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +40 -0
  321. data/dist/ice/cpp/src/Ice/SSL/TrustManager.cpp +222 -0
  322. data/dist/ice/cpp/src/Ice/SSL/TrustManager.h +42 -0
  323. data/dist/ice/cpp/src/Ice/SSL/TrustManagerF.h +14 -0
  324. data/dist/ice/cpp/src/Ice/ScannerConfig.h +35 -0
  325. data/dist/ice/cpp/src/Ice/Selector.cpp +1270 -0
  326. data/dist/ice/cpp/src/Ice/Selector.h +235 -0
  327. data/dist/ice/cpp/src/Ice/ServantManager.cpp +547 -0
  328. data/dist/ice/cpp/src/Ice/ServantManager.h +66 -0
  329. data/dist/ice/cpp/src/Ice/ServantManagerF.h +14 -0
  330. data/dist/ice/cpp/src/Ice/Service.cpp +1790 -0
  331. data/dist/ice/cpp/src/Ice/SharedContext.h +33 -0
  332. data/dist/ice/cpp/src/Ice/SliceLoader.cpp +53 -0
  333. data/dist/ice/cpp/src/Ice/SlicedData.cpp +48 -0
  334. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +472 -0
  335. data/dist/ice/cpp/src/Ice/StreamSocket.h +73 -0
  336. data/dist/ice/cpp/src/Ice/StringConverter.cpp +582 -0
  337. data/dist/ice/cpp/src/Ice/StringUtil.cpp +1137 -0
  338. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +160 -0
  339. data/dist/ice/cpp/src/Ice/SysLoggerI.h +34 -0
  340. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +65 -0
  341. data/dist/ice/cpp/src/Ice/SystemdJournalI.h +33 -0
  342. data/dist/ice/cpp/src/Ice/TargetCompare.h +96 -0
  343. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +213 -0
  344. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +55 -0
  345. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +128 -0
  346. data/dist/ice/cpp/src/Ice/TcpConnector.h +36 -0
  347. data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +411 -0
  348. data/dist/ice/cpp/src/Ice/TcpEndpointI.h +86 -0
  349. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +147 -0
  350. data/dist/ice/cpp/src/Ice/TcpTransceiver.h +53 -0
  351. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +1110 -0
  352. data/dist/ice/cpp/src/Ice/ThreadPool.h +305 -0
  353. data/dist/ice/cpp/src/Ice/ThreadPoolF.h +14 -0
  354. data/dist/ice/cpp/src/Ice/TimeUtil.cpp +47 -0
  355. data/dist/ice/cpp/src/Ice/TimeUtil.h +21 -0
  356. data/dist/ice/cpp/src/Ice/Timer.cpp +169 -0
  357. data/dist/ice/cpp/src/Ice/Timer.h +212 -0
  358. data/dist/ice/cpp/src/Ice/TraceLevels.cpp +20 -0
  359. data/dist/ice/cpp/src/Ice/TraceLevels.h +39 -0
  360. data/dist/ice/cpp/src/Ice/TraceLevelsF.h +14 -0
  361. data/dist/ice/cpp/src/Ice/TraceUtil.cpp +399 -0
  362. data/dist/ice/cpp/src/Ice/TraceUtil.h +41 -0
  363. data/dist/ice/cpp/src/Ice/Transceiver.cpp +14 -0
  364. data/dist/ice/cpp/src/Ice/Transceiver.h +52 -0
  365. data/dist/ice/cpp/src/Ice/TransceiverF.h +23 -0
  366. data/dist/ice/cpp/src/Ice/UUID.cpp +79 -0
  367. data/dist/ice/cpp/src/Ice/UdpConnector.cpp +131 -0
  368. data/dist/ice/cpp/src/Ice/UdpConnector.h +36 -0
  369. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +480 -0
  370. data/dist/ice/cpp/src/Ice/UdpEndpointI.h +92 -0
  371. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +786 -0
  372. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +90 -0
  373. data/dist/ice/cpp/src/Ice/UndefSysMacros.h +37 -0
  374. data/dist/ice/cpp/src/Ice/UniqueRef.h +77 -0
  375. data/dist/ice/cpp/src/Ice/UserException.cpp +58 -0
  376. data/dist/ice/cpp/src/Ice/Value.cpp +145 -0
  377. data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +87 -0
  378. data/dist/ice/cpp/src/Ice/WSAcceptor.h +46 -0
  379. data/dist/ice/cpp/src/Ice/WSConnector.cpp +87 -0
  380. data/dist/ice/cpp/src/Ice/WSConnector.h +36 -0
  381. data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +455 -0
  382. data/dist/ice/cpp/src/Ice/WSEndpoint.h +82 -0
  383. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +1715 -0
  384. data/dist/ice/cpp/src/Ice/WSTransceiver.h +135 -0
  385. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +40 -0
  386. data/dist/ice/cpp/src/Ice/generated/Context.cpp +40 -0
  387. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +40 -0
  388. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +47 -0
  389. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +752 -0
  390. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +577 -0
  391. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +1205 -0
  392. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +56 -0
  393. data/dist/ice/cpp/src/Ice/generated/Process.cpp +330 -0
  394. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +443 -0
  395. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +40 -0
  396. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +851 -0
  397. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +70 -0
  398. data/dist/ice/cpp/src/Ice/generated/Router.cpp +660 -0
  399. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +39 -0
  400. data/dist/ice/cpp/src/Ice/generated/Version.cpp +54 -0
  401. data/dist/ice/cpp/src/IceDiscovery/LocatorI.cpp +202 -0
  402. data/dist/ice/cpp/src/IceDiscovery/LocatorI.h +68 -0
  403. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +494 -0
  404. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +168 -0
  405. data/dist/ice/cpp/src/IceDiscovery/PluginI.cpp +155 -0
  406. data/dist/ice/cpp/src/IceDiscovery/PluginI.h +31 -0
  407. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +638 -0
  408. data/dist/ice/cpp/src/IceLocatorDiscovery/Plugin.h +24 -0
  409. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +822 -0
  410. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +468 -0
  411. data/dist/ice/cpp/src/Slice/DeprecationReporter.cpp +172 -0
  412. data/dist/ice/cpp/src/Slice/DeprecationReporter.h +14 -0
  413. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +736 -0
  414. data/dist/ice/cpp/src/Slice/DocCommentParser.h +61 -0
  415. data/dist/ice/cpp/src/Slice/FileTracker.cpp +96 -0
  416. data/dist/ice/cpp/src/Slice/FileTracker.h +44 -0
  417. data/dist/ice/cpp/src/Slice/Grammar.cpp +4125 -0
  418. data/dist/ice/cpp/src/Slice/Grammar.h +138 -0
  419. data/dist/ice/cpp/src/Slice/GrammarUtil.h +128 -0
  420. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +473 -0
  421. data/dist/ice/cpp/src/Slice/MetadataValidation.h +106 -0
  422. data/dist/ice/cpp/src/Slice/Parser.cpp +4906 -0
  423. data/dist/ice/cpp/src/Slice/Parser.h +1175 -0
  424. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +295 -0
  425. data/dist/ice/cpp/src/Slice/Preprocessor.h +44 -0
  426. data/dist/ice/cpp/src/Slice/Scanner.cpp +3445 -0
  427. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +790 -0
  428. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +448 -0
  429. data/dist/ice/cpp/src/Slice/Util.h +134 -0
  430. data/dist/ice/cpp/src/slice2rb/Main.cpp +33 -0
  431. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +250 -0
  432. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +1197 -0
  433. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +56 -0
  434. data/dist/ice/mcpp/internal.H +530 -0
  435. data/dist/ice/slice/Glacier2/Metrics.ice +47 -0
  436. data/dist/ice/slice/Glacier2/PermissionsVerifier.ice +55 -0
  437. data/dist/ice/slice/Glacier2/Router.ice +93 -0
  438. data/dist/ice/slice/Glacier2/SSLInfo.ice +42 -0
  439. data/dist/ice/slice/Glacier2/Session.ice +133 -0
  440. data/dist/ice/slice/Ice/BuiltinSequences.ice +54 -0
  441. data/dist/ice/slice/Ice/Context.ice +24 -0
  442. data/dist/ice/slice/Ice/EndpointTypes.ice +50 -0
  443. data/dist/ice/slice/Ice/Identity.ice +36 -0
  444. data/dist/ice/slice/Ice/Locator.ice +74 -0
  445. data/dist/ice/slice/Ice/LocatorRegistry.ice +77 -0
  446. data/dist/ice/slice/Ice/Metrics.ice +201 -0
  447. data/dist/ice/slice/Ice/OperationMode.ice +38 -0
  448. data/dist/ice/slice/Ice/Process.ice +28 -0
  449. data/dist/ice/slice/Ice/PropertiesAdmin.ice +37 -0
  450. data/dist/ice/slice/Ice/PropertyDict.ice +23 -0
  451. data/dist/ice/slice/Ice/RemoteLogger.ice +126 -0
  452. data/dist/ice/slice/Ice/ReplyStatus.ice +65 -0
  453. data/dist/ice/slice/Ice/Router.ice +54 -0
  454. data/dist/ice/slice/Ice/SliceChecksumDict.ice +18 -0
  455. data/dist/ice/slice/Ice/Version.ice +43 -0
  456. data/dist/ice/slice/IceBox/ServiceManager.ice +79 -0
  457. data/dist/ice/slice/IceGrid/Admin.ice +981 -0
  458. data/dist/ice/slice/IceGrid/Descriptor.ice +519 -0
  459. data/dist/ice/slice/IceGrid/Exception.ice +98 -0
  460. data/dist/ice/slice/IceGrid/FileParser.ice +36 -0
  461. data/dist/ice/slice/IceGrid/Registry.ice +130 -0
  462. data/dist/ice/slice/IceGrid/Session.ice +64 -0
  463. data/dist/ice/slice/IceGrid/UserAccountMapper.ice +34 -0
  464. data/dist/ice/slice/IceStorm/IceStorm.ice +186 -0
  465. data/dist/ice/slice/IceStorm/Metrics.ice +41 -0
  466. data/dist/lib/Glacier2/Metrics.rb +41 -0
  467. data/dist/lib/Glacier2/PermissionsVerifier.rb +61 -0
  468. data/dist/lib/Glacier2/Router.rb +73 -0
  469. data/dist/lib/Glacier2/SSLInfo.rb +64 -0
  470. data/dist/lib/Glacier2/Session.rb +187 -0
  471. data/dist/lib/Glacier2.rb +7 -0
  472. data/dist/lib/Ice/BuiltinSequences.rb +48 -0
  473. data/dist/lib/Ice/CompressBatch.rb +50 -0
  474. data/dist/lib/Ice/Context.rb +12 -0
  475. data/dist/lib/Ice/EndpointSelectionType.rb +49 -0
  476. data/dist/lib/Ice/EndpointTypes.rb +28 -0
  477. data/dist/lib/Ice/Exception.rb +20 -0
  478. data/dist/lib/Ice/Identity.rb +47 -0
  479. data/dist/lib/Ice/IdentitySpaceship.rb +16 -0
  480. data/dist/lib/Ice/InitializationData.rb +12 -0
  481. data/dist/lib/Ice/LocalExceptions.rb +168 -0
  482. data/dist/lib/Ice/Locator.rb +83 -0
  483. data/dist/lib/Ice/LocatorRegistry.rb +73 -0
  484. data/dist/lib/Ice/Metrics.rb +290 -0
  485. data/dist/lib/Ice/OperationMode.rb +58 -0
  486. data/dist/lib/Ice/Process.rb +34 -0
  487. data/dist/lib/Ice/PropertiesAdmin.rb +39 -0
  488. data/dist/lib/Ice/PropertyDict.rb +12 -0
  489. data/dist/lib/Ice/Proxy.rb +85 -0
  490. data/dist/lib/Ice/ProxyFunctions.rb +69 -0
  491. data/dist/lib/Ice/RemoteLogger.rb +176 -0
  492. data/dist/lib/Ice/ReplyStatus.rb +65 -0
  493. data/dist/lib/Ice/Router.rb +59 -0
  494. data/dist/lib/Ice/SliceChecksumDict.rb +12 -0
  495. data/dist/lib/Ice/SliceUtil.rb +41 -0
  496. data/dist/lib/Ice/Struct.rb +11 -0
  497. data/dist/lib/Ice/ToStringMode.rb +50 -0
  498. data/dist/lib/Ice/Value.rb +93 -0
  499. data/dist/lib/Ice/Version.rb +78 -0
  500. data/dist/lib/Ice.rb +37 -0
  501. data/dist/lib/IceBox/ServiceManager.rb +104 -0
  502. data/dist/lib/IceBox.rb +3 -0
  503. data/dist/lib/IceGrid/Admin.rb +1208 -0
  504. data/dist/lib/IceGrid/Descriptor.rb +989 -0
  505. data/dist/lib/IceGrid/Exception.rb +145 -0
  506. data/dist/lib/IceGrid/FileParser.rb +41 -0
  507. data/dist/lib/IceGrid/Registry.rb +168 -0
  508. data/dist/lib/IceGrid/Session.rb +56 -0
  509. data/dist/lib/IceGrid/UserAccountMapper.rb +38 -0
  510. data/dist/lib/IceGrid.rb +9 -0
  511. data/dist/lib/IceStorm/IceStorm.rb +251 -0
  512. data/dist/lib/IceStorm/Metrics.rb +55 -0
  513. data/dist/lib/IceStorm.rb +4 -0
  514. data/extconf.rb +89 -0
  515. data/ice.gemspec +22 -17
  516. data/scripts/slice2rb +10 -0
  517. metadata +536 -712
  518. data/ICE_LICENSE +0 -48
  519. data/LICENSE +0 -340
  520. data/MCPP_LICENSE +0 -29
  521. data/bin/slice2rb +0 -12
  522. data/ext/Communicator.cpp +0 -792
  523. data/ext/Communicator.h +0 -20
  524. data/ext/Config.h +0 -143
  525. data/ext/Connection.cpp +0 -532
  526. data/ext/Connection.h +0 -24
  527. data/ext/Endpoint.cpp +0 -340
  528. data/ext/Endpoint.h +0 -22
  529. data/ext/ImplicitContext.cpp +0 -144
  530. data/ext/ImplicitContext.h +0 -20
  531. data/ext/Init.cpp +0 -49
  532. data/ext/Logger.cpp +0 -147
  533. data/ext/Logger.h +0 -23
  534. data/ext/Operation.cpp +0 -661
  535. data/ext/Operation.h +0 -31
  536. data/ext/Properties.cpp +0 -365
  537. data/ext/Properties.h +0 -20
  538. data/ext/Proxy.cpp +0 -1396
  539. data/ext/Proxy.h +0 -22
  540. data/ext/Slice.cpp +0 -205
  541. data/ext/Slice.h +0 -17
  542. data/ext/Types.cpp +0 -3325
  543. data/ext/Types.h +0 -595
  544. data/ext/Util.cpp +0 -812
  545. data/ext/Util.h +0 -586
  546. data/ext/ValueFactoryManager.cpp +0 -441
  547. data/ext/ValueFactoryManager.h +0 -95
  548. data/ext/extconf.rb +0 -97
  549. data/ext/ice/cpp/include/Ice/Application.h +0 -326
  550. data/ext/ice/cpp/include/Ice/AsyncResult.h +0 -155
  551. data/ext/ice/cpp/include/Ice/AsyncResultF.h +0 -23
  552. data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +0 -75
  553. data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +0 -20
  554. data/ext/ice/cpp/include/Ice/Buffer.h +0 -154
  555. data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +0 -154
  556. data/ext/ice/cpp/include/Ice/Comparable.h +0 -205
  557. data/ext/ice/cpp/include/Ice/Config.h +0 -78
  558. data/ext/ice/cpp/include/Ice/ConnectionAsync.h +0 -302
  559. data/ext/ice/cpp/include/Ice/ConnectionIF.h +0 -38
  560. data/ext/ice/cpp/include/Ice/ConsoleUtil.h +0 -23
  561. data/ext/ice/cpp/include/Ice/DefaultValueFactory.h +0 -57
  562. data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +0 -41
  563. data/ext/ice/cpp/include/Ice/Dispatcher.h +0 -67
  564. data/ext/ice/cpp/include/Ice/DynamicLibrary.h +0 -102
  565. data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +0 -24
  566. data/ext/ice/cpp/include/Ice/Exception.h +0 -161
  567. data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +0 -74
  568. data/ext/ice/cpp/include/Ice/FactoryTable.h +0 -73
  569. data/ext/ice/cpp/include/Ice/FactoryTableInit.h +0 -84
  570. data/ext/ice/cpp/include/Ice/Format.h +0 -38
  571. data/ext/ice/cpp/include/Ice/Functional.h +0 -140
  572. data/ext/ice/cpp/include/Ice/GCObject.h +0 -76
  573. data/ext/ice/cpp/include/Ice/Handle.h +0 -182
  574. data/ext/ice/cpp/include/Ice/Ice.h +0 -55
  575. data/ext/ice/cpp/include/Ice/IconvStringConverter.h +0 -377
  576. data/ext/ice/cpp/include/Ice/Incoming.h +0 -225
  577. data/ext/ice/cpp/include/Ice/IncomingAsync.h +0 -186
  578. data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +0 -36
  579. data/ext/ice/cpp/include/Ice/Initialize.h +0 -957
  580. data/ext/ice/cpp/include/Ice/InputStream.h +0 -1514
  581. data/ext/ice/cpp/include/Ice/InstanceF.h +0 -20
  582. data/ext/ice/cpp/include/Ice/InterfaceByValue.h +0 -57
  583. data/ext/ice/cpp/include/Ice/LocalObject.h +0 -35
  584. data/ext/ice/cpp/include/Ice/LocalObjectF.h +0 -21
  585. data/ext/ice/cpp/include/Ice/LoggerUtil.h +0 -185
  586. data/ext/ice/cpp/include/Ice/MetricsAdminI.h +0 -715
  587. data/ext/ice/cpp/include/Ice/MetricsFunctional.h +0 -159
  588. data/ext/ice/cpp/include/Ice/MetricsObserverI.h +0 -669
  589. data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +0 -86
  590. data/ext/ice/cpp/include/Ice/Object.h +0 -507
  591. data/ext/ice/cpp/include/Ice/ObjectF.h +0 -30
  592. data/ext/ice/cpp/include/Ice/ObserverHelper.h +0 -182
  593. data/ext/ice/cpp/include/Ice/Optional.h +0 -1114
  594. data/ext/ice/cpp/include/Ice/OutgoingAsync.h +0 -856
  595. data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +0 -39
  596. data/ext/ice/cpp/include/Ice/OutputStream.h +0 -1092
  597. data/ext/ice/cpp/include/Ice/Protocol.h +0 -274
  598. data/ext/ice/cpp/include/Ice/Proxy.h +0 -5154
  599. data/ext/ice/cpp/include/Ice/ProxyF.h +0 -53
  600. data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +0 -21
  601. data/ext/ice/cpp/include/Ice/ProxyHandle.h +0 -318
  602. data/ext/ice/cpp/include/Ice/ReferenceF.h +0 -29
  603. data/ext/ice/cpp/include/Ice/RegisterPlugins.h +0 -127
  604. data/ext/ice/cpp/include/Ice/RequestHandlerF.h +0 -30
  605. data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +0 -25
  606. data/ext/ice/cpp/include/Ice/SHA1.h +0 -42
  607. data/ext/ice/cpp/include/Ice/ServantManagerF.h +0 -21
  608. data/ext/ice/cpp/include/Ice/Service.h +0 -379
  609. data/ext/ice/cpp/include/Ice/SliceChecksums.h +0 -33
  610. data/ext/ice/cpp/include/Ice/SlicedData.h +0 -172
  611. data/ext/ice/cpp/include/Ice/SlicedDataF.h +0 -40
  612. data/ext/ice/cpp/include/Ice/StreamHelpers.h +0 -1190
  613. data/ext/ice/cpp/include/Ice/StringConverter.h +0 -78
  614. data/ext/ice/cpp/include/Ice/ThreadPoolF.h +0 -23
  615. data/ext/ice/cpp/include/Ice/UUID.h +0 -19
  616. data/ext/ice/cpp/include/Ice/UniquePtr.h +0 -95
  617. data/ext/ice/cpp/include/Ice/UniqueRef.h +0 -97
  618. data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +0 -88
  619. data/ext/ice/cpp/include/Ice/Value.h +0 -139
  620. data/ext/ice/cpp/include/Ice/ValueF.h +0 -21
  621. data/ext/ice/cpp/include/IceSSL/Config.h +0 -21
  622. data/ext/ice/cpp/include/IceSSL/IceSSL.h +0 -28
  623. data/ext/ice/cpp/include/IceSSL/OpenSSL.h +0 -147
  624. data/ext/ice/cpp/include/IceSSL/Plugin.h +0 -712
  625. data/ext/ice/cpp/include/IceSSL/SChannel.h +0 -72
  626. data/ext/ice/cpp/include/IceSSL/SecureTransport.h +0 -72
  627. data/ext/ice/cpp/include/IceSSL/UWP.h +0 -62
  628. data/ext/ice/cpp/include/IceUtil/Atomic.h +0 -179
  629. data/ext/ice/cpp/include/IceUtil/Cond.h +0 -317
  630. data/ext/ice/cpp/include/IceUtil/Config.h +0 -424
  631. data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +0 -92
  632. data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +0 -45
  633. data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +0 -92
  634. data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +0 -44
  635. data/ext/ice/cpp/include/IceUtil/Exception.h +0 -394
  636. data/ext/ice/cpp/include/IceUtil/FileUtil.h +0 -143
  637. data/ext/ice/cpp/include/IceUtil/Functional.h +0 -389
  638. data/ext/ice/cpp/include/IceUtil/Handle.h +0 -261
  639. data/ext/ice/cpp/include/IceUtil/IceUtil.h +0 -40
  640. data/ext/ice/cpp/include/IceUtil/InputUtil.h +0 -42
  641. data/ext/ice/cpp/include/IceUtil/Iterator.h +0 -31
  642. data/ext/ice/cpp/include/IceUtil/Lock.h +0 -128
  643. data/ext/ice/cpp/include/IceUtil/Monitor.h +0 -243
  644. data/ext/ice/cpp/include/IceUtil/Mutex.h +0 -353
  645. data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +0 -23
  646. data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +0 -78
  647. data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +0 -77
  648. data/ext/ice/cpp/include/IceUtil/Optional.h +0 -433
  649. data/ext/ice/cpp/include/IceUtil/Options.h +0 -135
  650. data/ext/ice/cpp/include/IceUtil/OutputUtil.h +0 -383
  651. data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +0 -14
  652. data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +0 -33
  653. data/ext/ice/cpp/include/IceUtil/Random.h +0 -55
  654. data/ext/ice/cpp/include/IceUtil/RecMutex.h +0 -107
  655. data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +0 -53
  656. data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +0 -40
  657. data/ext/ice/cpp/include/IceUtil/ScopedArray.h +0 -98
  658. data/ext/ice/cpp/include/IceUtil/Shared.h +0 -127
  659. data/ext/ice/cpp/include/IceUtil/StopWatch.h +0 -49
  660. data/ext/ice/cpp/include/IceUtil/StringConverter.h +0 -195
  661. data/ext/ice/cpp/include/IceUtil/StringUtil.h +0 -97
  662. data/ext/ice/cpp/include/IceUtil/Thread.h +0 -174
  663. data/ext/ice/cpp/include/IceUtil/ThreadException.h +0 -94
  664. data/ext/ice/cpp/include/IceUtil/Time.h +0 -205
  665. data/ext/ice/cpp/include/IceUtil/Timer.h +0 -143
  666. data/ext/ice/cpp/include/IceUtil/UUID.h +0 -21
  667. data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +0 -37
  668. data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +0 -170
  669. data/ext/ice/cpp/include/generated/Ice/Communicator.h +0 -1162
  670. data/ext/ice/cpp/include/generated/Ice/CommunicatorF.h +0 -101
  671. data/ext/ice/cpp/include/generated/Ice/Connection.h +0 -1703
  672. data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +0 -119
  673. data/ext/ice/cpp/include/generated/Ice/Current.h +0 -322
  674. data/ext/ice/cpp/include/generated/Ice/Endpoint.h +0 -979
  675. data/ext/ice/cpp/include/generated/Ice/EndpointF.h +0 -166
  676. data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +0 -118
  677. data/ext/ice/cpp/include/generated/Ice/FacetMap.h +0 -80
  678. data/ext/ice/cpp/include/generated/Ice/Identity.h +0 -264
  679. data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +0 -284
  680. data/ext/ice/cpp/include/generated/Ice/ImplicitContextF.h +0 -101
  681. data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +0 -1203
  682. data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +0 -128
  683. data/ext/ice/cpp/include/generated/Ice/LocalException.h +0 -7437
  684. data/ext/ice/cpp/include/generated/Ice/Locator.h +0 -3898
  685. data/ext/ice/cpp/include/generated/Ice/LocatorF.h +0 -147
  686. data/ext/ice/cpp/include/generated/Ice/Logger.h +0 -237
  687. data/ext/ice/cpp/include/generated/Ice/LoggerF.h +0 -101
  688. data/ext/ice/cpp/include/generated/Ice/Metrics.h +0 -4769
  689. data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +0 -1181
  690. data/ext/ice/cpp/include/generated/Ice/ObjectAdapterF.h +0 -101
  691. data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +0 -203
  692. data/ext/ice/cpp/include/generated/Ice/Plugin.h +0 -318
  693. data/ext/ice/cpp/include/generated/Ice/PluginF.h +0 -110
  694. data/ext/ice/cpp/include/generated/Ice/Process.h +0 -977
  695. data/ext/ice/cpp/include/generated/Ice/ProcessF.h +0 -125
  696. data/ext/ice/cpp/include/generated/Ice/Properties.h +0 -452
  697. data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +0 -1366
  698. data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +0 -134
  699. data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +0 -2707
  700. data/ext/ice/cpp/include/generated/Ice/Router.h +0 -1850
  701. data/ext/ice/cpp/include/generated/Ice/RouterF.h +0 -125
  702. data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +0 -305
  703. data/ext/ice/cpp/include/generated/Ice/ServantLocatorF.h +0 -101
  704. data/ext/ice/cpp/include/generated/Ice/SliceChecksumDict.h +0 -84
  705. data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +0 -330
  706. data/ext/ice/cpp/include/generated/Ice/Version.h +0 -357
  707. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +0 -228
  708. data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +0 -101
  709. data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +0 -186
  710. data/ext/ice/cpp/src/Ice/ACM.cpp +0 -380
  711. data/ext/ice/cpp/src/Ice/ACM.h +0 -119
  712. data/ext/ice/cpp/src/Ice/ACMF.h +0 -30
  713. data/ext/ice/cpp/src/Ice/Acceptor.cpp +0 -16
  714. data/ext/ice/cpp/src/Ice/Acceptor.h +0 -37
  715. data/ext/ice/cpp/src/Ice/AcceptorF.h +0 -25
  716. data/ext/ice/cpp/src/Ice/ArgVector.cpp +0 -59
  717. data/ext/ice/cpp/src/Ice/ArgVector.h +0 -36
  718. data/ext/ice/cpp/src/Ice/AsyncResult.cpp +0 -70
  719. data/ext/ice/cpp/src/Ice/Base64.cpp +0 -263
  720. data/ext/ice/cpp/src/Ice/Base64.h +0 -31
  721. data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +0 -250
  722. data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +0 -59
  723. data/ext/ice/cpp/src/Ice/Buffer.cpp +0 -155
  724. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +0 -49
  725. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +0 -407
  726. data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +0 -87
  727. data/ext/ice/cpp/src/Ice/Communicator.cpp +0 -79
  728. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +0 -61
  729. data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +0 -586
  730. data/ext/ice/cpp/src/Ice/CommunicatorI.h +0 -167
  731. data/ext/ice/cpp/src/Ice/Cond.cpp +0 -381
  732. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +0 -348
  733. data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +0 -72
  734. data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +0 -24
  735. data/ext/ice/cpp/src/Ice/Connection.cpp +0 -155
  736. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +0 -61
  737. data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +0 -1972
  738. data/ext/ice/cpp/src/Ice/ConnectionFactory.h +0 -264
  739. data/ext/ice/cpp/src/Ice/ConnectionFactoryF.h +0 -30
  740. data/ext/ice/cpp/src/Ice/ConnectionI.cpp +0 -3670
  741. data/ext/ice/cpp/src/Ice/ConnectionI.h +0 -391
  742. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +0 -73
  743. data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +0 -41
  744. data/ext/ice/cpp/src/Ice/Connector.cpp +0 -16
  745. data/ext/ice/cpp/src/Ice/Connector.h +0 -32
  746. data/ext/ice/cpp/src/Ice/ConnectorF.h +0 -21
  747. data/ext/ice/cpp/src/Ice/CountDownLatch.cpp +0 -179
  748. data/ext/ice/cpp/src/Ice/Current.cpp +0 -62
  749. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +0 -161
  750. data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +0 -52
  751. data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +0 -21
  752. data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +0 -37
  753. data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +0 -291
  754. data/ext/ice/cpp/src/Ice/Endpoint.cpp +0 -147
  755. data/ext/ice/cpp/src/Ice/EndpointF.cpp +0 -61
  756. data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +0 -189
  757. data/ext/ice/cpp/src/Ice/EndpointFactory.h +0 -117
  758. data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +0 -21
  759. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +0 -213
  760. data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +0 -47
  761. data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +0 -21
  762. data/ext/ice/cpp/src/Ice/EndpointI.cpp +0 -98
  763. data/ext/ice/cpp/src/Ice/EndpointI.h +0 -218
  764. data/ext/ice/cpp/src/Ice/EndpointIF.h +0 -49
  765. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +0 -51
  766. data/ext/ice/cpp/src/Ice/EventHandler.cpp +0 -32
  767. data/ext/ice/cpp/src/Ice/EventHandler.h +0 -81
  768. data/ext/ice/cpp/src/Ice/EventHandlerF.h +0 -24
  769. data/ext/ice/cpp/src/Ice/Exception.cpp +0 -845
  770. data/ext/ice/cpp/src/Ice/FacetMap.cpp +0 -49
  771. data/ext/ice/cpp/src/Ice/FactoryTable.cpp +0 -162
  772. data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +0 -88
  773. data/ext/ice/cpp/src/Ice/GCObject.cpp +0 -442
  774. data/ext/ice/cpp/src/Ice/HashUtil.h +0 -53
  775. data/ext/ice/cpp/src/Ice/HttpParser.cpp +0 -684
  776. data/ext/ice/cpp/src/Ice/HttpParser.h +0 -117
  777. data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +0 -756
  778. data/ext/ice/cpp/src/Ice/IPEndpointI.h +0 -162
  779. data/ext/ice/cpp/src/Ice/IPEndpointIF.h +0 -28
  780. data/ext/ice/cpp/src/Ice/IconvStringConverter.cpp +0 -51
  781. data/ext/ice/cpp/src/Ice/Identity.cpp +0 -57
  782. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +0 -75
  783. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +0 -61
  784. data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +0 -655
  785. data/ext/ice/cpp/src/Ice/ImplicitContextI.h +0 -48
  786. data/ext/ice/cpp/src/Ice/Incoming.cpp +0 -795
  787. data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +0 -230
  788. data/ext/ice/cpp/src/Ice/IncomingRequest.h +0 -33
  789. data/ext/ice/cpp/src/Ice/Initialize.cpp +0 -654
  790. data/ext/ice/cpp/src/Ice/InputStream.cpp +0 -2741
  791. data/ext/ice/cpp/src/Ice/Instance.cpp +0 -1971
  792. data/ext/ice/cpp/src/Ice/Instance.h +0 -235
  793. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +0 -188
  794. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +0 -66
  795. data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +0 -1094
  796. data/ext/ice/cpp/src/Ice/InstrumentationI.h +0 -256
  797. data/ext/ice/cpp/src/Ice/LocalException.cpp +0 -3262
  798. data/ext/ice/cpp/src/Ice/LocalObject.cpp +0 -23
  799. data/ext/ice/cpp/src/Ice/Locator.cpp +0 -2042
  800. data/ext/ice/cpp/src/Ice/LocatorF.cpp +0 -63
  801. data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +0 -889
  802. data/ext/ice/cpp/src/Ice/LocatorInfo.h +0 -189
  803. data/ext/ice/cpp/src/Ice/LocatorInfoF.h +0 -29
  804. data/ext/ice/cpp/src/Ice/Logger.cpp +0 -73
  805. data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +0 -956
  806. data/ext/ice/cpp/src/Ice/LoggerAdminI.h +0 -41
  807. data/ext/ice/cpp/src/Ice/LoggerF.cpp +0 -61
  808. data/ext/ice/cpp/src/Ice/LoggerI.cpp +0 -261
  809. data/ext/ice/cpp/src/Ice/LoggerI.h +0 -52
  810. data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +0 -100
  811. data/ext/ice/cpp/src/Ice/Metrics.cpp +0 -2352
  812. data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +0 -694
  813. data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +0 -8
  814. data/ext/ice/cpp/src/Ice/Network.cpp +0 -3075
  815. data/ext/ice/cpp/src/Ice/Network.h +0 -371
  816. data/ext/ice/cpp/src/Ice/NetworkF.h +0 -23
  817. data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +0 -324
  818. data/ext/ice/cpp/src/Ice/NetworkProxy.h +0 -72
  819. data/ext/ice/cpp/src/Ice/NetworkProxyF.h +0 -21
  820. data/ext/ice/cpp/src/Ice/OSLogLoggerI.cpp +0 -57
  821. data/ext/ice/cpp/src/Ice/OSLogLoggerI.h +0 -40
  822. data/ext/ice/cpp/src/Ice/Object.cpp +0 -435
  823. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +0 -79
  824. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +0 -61
  825. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +0 -291
  826. data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +0 -53
  827. data/ext/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +0 -25
  828. data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +0 -1530
  829. data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +0 -159
  830. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +0 -75
  831. data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +0 -56
  832. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +0 -408
  833. data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +0 -74
  834. data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +0 -1322
  835. data/ext/ice/cpp/src/Ice/OutputStream.cpp +0 -1367
  836. data/ext/ice/cpp/src/Ice/Plugin.cpp +0 -87
  837. data/ext/ice/cpp/src/Ice/PluginF.cpp +0 -61
  838. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +0 -503
  839. data/ext/ice/cpp/src/Ice/PluginManagerI.h +0 -61
  840. data/ext/ice/cpp/src/Ice/Process.cpp +0 -471
  841. data/ext/ice/cpp/src/Ice/ProcessF.cpp +0 -63
  842. data/ext/ice/cpp/src/Ice/Properties.cpp +0 -78
  843. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +0 -603
  844. data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +0 -265
  845. data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +0 -64
  846. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +0 -63
  847. data/ext/ice/cpp/src/Ice/PropertiesI.cpp +0 -747
  848. data/ext/ice/cpp/src/Ice/PropertiesI.h +0 -70
  849. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +0 -1429
  850. data/ext/ice/cpp/src/Ice/PropertyNames.h +0 -78
  851. data/ext/ice/cpp/src/Ice/Protocol.cpp +0 -124
  852. data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -131
  853. data/ext/ice/cpp/src/Ice/ProtocolInstance.h +0 -93
  854. data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +0 -21
  855. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +0 -51
  856. data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +0 -64
  857. data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +0 -21
  858. data/ext/ice/cpp/src/Ice/Proxy.cpp +0 -1601
  859. data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +0 -300
  860. data/ext/ice/cpp/src/Ice/ProxyFactory.h +0 -57
  861. data/ext/ice/cpp/src/Ice/Reference.cpp +0 -2046
  862. data/ext/ice/cpp/src/Ice/Reference.h +0 -323
  863. data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +0 -888
  864. data/ext/ice/cpp/src/Ice/ReferenceFactory.h +0 -76
  865. data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +0 -19
  866. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.cpp +0 -38
  867. data/ext/ice/cpp/src/Ice/RegisterPluginsInit.h +0 -20
  868. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +0 -1171
  869. data/ext/ice/cpp/src/Ice/ReplyStatus.h +0 -24
  870. data/ext/ice/cpp/src/Ice/RequestHandler.cpp +0 -37
  871. data/ext/ice/cpp/src/Ice/RequestHandler.h +0 -78
  872. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +0 -77
  873. data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +0 -37
  874. data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +0 -12
  875. data/ext/ice/cpp/src/Ice/ResponseHandler.h +0 -43
  876. data/ext/ice/cpp/src/Ice/RetryQueue.cpp +0 -157
  877. data/ext/ice/cpp/src/Ice/RetryQueue.h +0 -66
  878. data/ext/ice/cpp/src/Ice/RetryQueueF.h +0 -19
  879. data/ext/ice/cpp/src/Ice/Router.cpp +0 -977
  880. data/ext/ice/cpp/src/Ice/RouterF.cpp +0 -63
  881. data/ext/ice/cpp/src/Ice/RouterInfo.cpp +0 -379
  882. data/ext/ice/cpp/src/Ice/RouterInfo.h +0 -152
  883. data/ext/ice/cpp/src/Ice/RouterInfoF.h +0 -25
  884. data/ext/ice/cpp/src/Ice/SHA1.cpp +0 -185
  885. data/ext/ice/cpp/src/Ice/Selector.cpp +0 -1537
  886. data/ext/ice/cpp/src/Ice/Selector.h +0 -308
  887. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +0 -75
  888. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +0 -61
  889. data/ext/ice/cpp/src/Ice/ServantManager.cpp +0 -480
  890. data/ext/ice/cpp/src/Ice/ServantManager.h +0 -69
  891. data/ext/ice/cpp/src/Ice/SharedContext.h +0 -46
  892. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +0 -49
  893. data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +0 -75
  894. data/ext/ice/cpp/src/Ice/SlicedData.cpp +0 -127
  895. data/ext/ice/cpp/src/Ice/StreamSocket.cpp +0 -682
  896. data/ext/ice/cpp/src/Ice/StreamSocket.h +0 -92
  897. data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +0 -192
  898. data/ext/ice/cpp/src/Ice/StringUtil.h +0 -30
  899. data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +0 -166
  900. data/ext/ice/cpp/src/Ice/SysLoggerI.h +0 -37
  901. data/ext/ice/cpp/src/Ice/SystemdJournalI.cpp +0 -66
  902. data/ext/ice/cpp/src/Ice/SystemdJournalI.h +0 -39
  903. data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +0 -355
  904. data/ext/ice/cpp/src/Ice/TcpAcceptor.h +0 -69
  905. data/ext/ice/cpp/src/Ice/TcpConnector.cpp +0 -127
  906. data/ext/ice/cpp/src/Ice/TcpConnector.h +0 -45
  907. data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +0 -385
  908. data/ext/ice/cpp/src/Ice/TcpEndpointI.h +0 -90
  909. data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +0 -135
  910. data/ext/ice/cpp/src/Ice/TcpTransceiver.h +0 -58
  911. data/ext/ice/cpp/src/Ice/Thread.cpp +0 -811
  912. data/ext/ice/cpp/src/Ice/ThreadPool.cpp +0 -1328
  913. data/ext/ice/cpp/src/Ice/ThreadPool.h +0 -393
  914. data/ext/ice/cpp/src/Ice/Timer.cpp +0 -263
  915. data/ext/ice/cpp/src/Ice/TraceLevels.cpp +0 -38
  916. data/ext/ice/cpp/src/Ice/TraceLevels.h +0 -45
  917. data/ext/ice/cpp/src/Ice/TraceLevelsF.h +0 -21
  918. data/ext/ice/cpp/src/Ice/TraceUtil.cpp +0 -478
  919. data/ext/ice/cpp/src/Ice/TraceUtil.h +0 -30
  920. data/ext/ice/cpp/src/Ice/Transceiver.cpp +0 -18
  921. data/ext/ice/cpp/src/Ice/Transceiver.h +0 -49
  922. data/ext/ice/cpp/src/Ice/TransceiverF.h +0 -33
  923. data/ext/ice/cpp/src/Ice/UdpConnector.cpp +0 -136
  924. data/ext/ice/cpp/src/Ice/UdpConnector.h +0 -45
  925. data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +0 -515
  926. data/ext/ice/cpp/src/Ice/UdpEndpointI.h +0 -95
  927. data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +0 -1153
  928. data/ext/ice/cpp/src/Ice/UdpTransceiver.h +0 -117
  929. data/ext/ice/cpp/src/Ice/Value.cpp +0 -76
  930. data/ext/ice/cpp/src/Ice/ValueFactory.cpp +0 -83
  931. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +0 -61
  932. data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.h +0 -37
  933. data/ext/ice/cpp/src/Ice/Version.cpp +0 -57
  934. data/ext/ice/cpp/src/Ice/VirtualShared.h +0 -38
  935. data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +0 -92
  936. data/ext/ice/cpp/src/Ice/WSAcceptor.h +0 -52
  937. data/ext/ice/cpp/src/Ice/WSConnector.cpp +0 -102
  938. data/ext/ice/cpp/src/Ice/WSConnector.h +0 -43
  939. data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +0 -508
  940. data/ext/ice/cpp/src/Ice/WSEndpoint.h +0 -93
  941. data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +0 -1747
  942. data/ext/ice/cpp/src/Ice/WSTransceiver.h +0 -141
  943. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +0 -915
  944. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +0 -1889
  945. data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +0 -265
  946. data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +0 -109
  947. data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +0 -608
  948. data/ext/ice/cpp/src/IceDiscovery/LookupI.h +0 -228
  949. data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +0 -176
  950. data/ext/ice/cpp/src/IceDiscovery/PluginI.h +0 -36
  951. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +0 -730
  952. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +0 -1197
  953. data/ext/ice/cpp/src/IceLocatorDiscovery/Plugin.h +0 -47
  954. data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +0 -1048
  955. data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +0 -105
  956. data/ext/ice/cpp/src/IceSSL/AcceptorI.h +0 -52
  957. data/ext/ice/cpp/src/IceSSL/CertificateI.cpp +0 -301
  958. data/ext/ice/cpp/src/IceSSL/CertificateI.h +0 -64
  959. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +0 -75
  960. data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +0 -61
  961. data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +0 -102
  962. data/ext/ice/cpp/src/IceSSL/ConnectorI.h +0 -44
  963. data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +0 -372
  964. data/ext/ice/cpp/src/IceSSL/EndpointI.h +0 -100
  965. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +0 -75
  966. data/ext/ice/cpp/src/IceSSL/Instance.cpp +0 -28
  967. data/ext/ice/cpp/src/IceSSL/Instance.h +0 -37
  968. data/ext/ice/cpp/src/IceSSL/InstanceF.h +0 -33
  969. data/ext/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +0 -688
  970. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +0 -1147
  971. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.h +0 -59
  972. data/ext/ice/cpp/src/IceSSL/OpenSSLEngineF.h +0 -27
  973. data/ext/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +0 -127
  974. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +0 -1092
  975. data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +0 -90
  976. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +0 -288
  977. data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.h +0 -58
  978. data/ext/ice/cpp/src/IceSSL/PluginI.cpp +0 -246
  979. data/ext/ice/cpp/src/IceSSL/PluginI.h +0 -67
  980. data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +0 -490
  981. data/ext/ice/cpp/src/IceSSL/RFC2253.h +0 -62
  982. data/ext/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +0 -721
  983. data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +0 -1283
  984. data/ext/ice/cpp/src/IceSSL/SChannelEngine.h +0 -123
  985. data/ext/ice/cpp/src/IceSSL/SChannelEngineF.h +0 -31
  986. data/ext/ice/cpp/src/IceSSL/SChannelPluginI.cpp +0 -73
  987. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +0 -1174
  988. data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +0 -133
  989. data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +0 -313
  990. data/ext/ice/cpp/src/IceSSL/SSLEngine.h +0 -100
  991. data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +0 -21
  992. data/ext/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +0 -999
  993. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +0 -1308
  994. data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.h +0 -59
  995. data/ext/ice/cpp/src/IceSSL/SecureTransportEngineF.h +0 -29
  996. data/ext/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +0 -75
  997. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +0 -719
  998. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +0 -92
  999. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +0 -868
  1000. data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.h +0 -45
  1001. data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +0 -236
  1002. data/ext/ice/cpp/src/IceSSL/TrustManager.h +0 -46
  1003. data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +0 -21
  1004. data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +0 -266
  1005. data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +0 -338
  1006. data/ext/ice/cpp/src/IceSSL/UWPEngine.h +0 -41
  1007. data/ext/ice/cpp/src/IceSSL/UWPEngineF.h +0 -26
  1008. data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +0 -89
  1009. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +0 -383
  1010. data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +0 -71
  1011. data/ext/ice/cpp/src/IceSSL/Util.cpp +0 -192
  1012. data/ext/ice/cpp/src/IceSSL/Util.h +0 -99
  1013. data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +0 -157
  1014. data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +0 -472
  1015. data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +0 -147
  1016. data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +0 -259
  1017. data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +0 -484
  1018. data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +0 -36
  1019. data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +0 -19
  1020. data/ext/ice/cpp/src/IceUtil/Options.cpp +0 -1051
  1021. data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +0 -609
  1022. data/ext/ice/cpp/src/IceUtil/Random.cpp +0 -180
  1023. data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +0 -242
  1024. data/ext/ice/cpp/src/IceUtil/Shared.cpp +0 -71
  1025. data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +0 -690
  1026. data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +0 -1180
  1027. data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +0 -130
  1028. data/ext/ice/cpp/src/IceUtil/Time.cpp +0 -307
  1029. data/ext/ice/cpp/src/IceUtil/UUID.cpp +0 -169
  1030. data/ext/ice/cpp/src/IceUtil/Unicode.cpp +0 -183
  1031. data/ext/ice/cpp/src/IceUtil/Unicode.h +0 -43
  1032. data/ext/ice/cpp/src/IceUtil/UtilException.cpp +0 -839
  1033. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +0 -1810
  1034. data/ext/ice/cpp/src/Slice/CPlusPlusUtil.h +0 -72
  1035. data/ext/ice/cpp/src/Slice/Checksum.cpp +0 -447
  1036. data/ext/ice/cpp/src/Slice/Checksum.h +0 -21
  1037. data/ext/ice/cpp/src/Slice/FileTracker.cpp +0 -146
  1038. data/ext/ice/cpp/src/Slice/FileTracker.h +0 -66
  1039. data/ext/ice/cpp/src/Slice/Grammar.cpp +0 -4793
  1040. data/ext/ice/cpp/src/Slice/Grammar.h +0 -118
  1041. data/ext/ice/cpp/src/Slice/GrammarUtil.h +0 -228
  1042. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +0 -5154
  1043. data/ext/ice/cpp/src/Slice/JavaUtil.h +0 -398
  1044. data/ext/ice/cpp/src/Slice/MD5.cpp +0 -52
  1045. data/ext/ice/cpp/src/Slice/MD5.h +0 -39
  1046. data/ext/ice/cpp/src/Slice/MD5I.cpp +0 -393
  1047. data/ext/ice/cpp/src/Slice/MD5I.h +0 -91
  1048. data/ext/ice/cpp/src/Slice/PHPUtil.cpp +0 -157
  1049. data/ext/ice/cpp/src/Slice/PHPUtil.h +0 -36
  1050. data/ext/ice/cpp/src/Slice/Parser.cpp +0 -7058
  1051. data/ext/ice/cpp/src/Slice/Parser.h +0 -1174
  1052. data/ext/ice/cpp/src/Slice/Preprocessor.cpp +0 -797
  1053. data/ext/ice/cpp/src/Slice/Preprocessor.h +0 -60
  1054. data/ext/ice/cpp/src/Slice/Python.cpp +0 -830
  1055. data/ext/ice/cpp/src/Slice/PythonUtil.cpp +0 -3439
  1056. data/ext/ice/cpp/src/Slice/PythonUtil.h +0 -70
  1057. data/ext/ice/cpp/src/Slice/Ruby.cpp +0 -350
  1058. data/ext/ice/cpp/src/Slice/RubyUtil.cpp +0 -1571
  1059. data/ext/ice/cpp/src/Slice/RubyUtil.h +0 -49
  1060. data/ext/ice/cpp/src/Slice/Scanner.cpp +0 -2807
  1061. data/ext/ice/cpp/src/Slice/SliceUtil.cpp +0 -424
  1062. data/ext/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -456
  1063. data/ext/ice/cpp/src/Slice/Util.h +0 -50
  1064. data/ext/ice/mcpp/CMakeLists.txt +0 -80
  1065. data/ext/ice/mcpp/LICENSE +0 -29
  1066. data/ext/ice/mcpp/Makefile +0 -63
  1067. data/ext/ice/mcpp/README.md +0 -32
  1068. data/ext/ice/mcpp/internal.H +0 -530
  1069. data/ext/ice/mcpp/mcpp.gyp +0 -88
  1070. data/lib/Glacier2/Metrics.rb +0 -56
  1071. data/lib/Glacier2/PermissionsVerifier.rb +0 -93
  1072. data/lib/Glacier2/PermissionsVerifierF.rb +0 -30
  1073. data/lib/Glacier2/Router.rb +0 -95
  1074. data/lib/Glacier2/RouterF.rb +0 -25
  1075. data/lib/Glacier2/SSLInfo.rb +0 -72
  1076. data/lib/Glacier2/Session.rb +0 -247
  1077. data/lib/Glacier2.rb +0 -7
  1078. data/lib/Ice/BuiltinSequences.rb +0 -60
  1079. data/lib/Ice/Communicator.rb +0 -87
  1080. data/lib/Ice/CommunicatorF.rb +0 -24
  1081. data/lib/Ice/Connection.rb +0 -413
  1082. data/lib/Ice/ConnectionF.rb +0 -32
  1083. data/lib/Ice/Current.rb +0 -141
  1084. data/lib/Ice/Endpoint.rb +0 -187
  1085. data/lib/Ice/EndpointF.rb +0 -48
  1086. data/lib/Ice/EndpointTypes.rb +0 -69
  1087. data/lib/Ice/FacetMap.rb +0 -24
  1088. data/lib/Ice/Identity.rb +0 -63
  1089. data/lib/Ice/ImplicitContext.rb +0 -26
  1090. data/lib/Ice/ImplicitContextF.rb +0 -24
  1091. data/lib/Ice/Instrumentation.rb +0 -169
  1092. data/lib/Ice/InstrumentationF.rb +0 -31
  1093. data/lib/Ice/LocalException.rb +0 -1031
  1094. data/lib/Ice/Locator.rb +0 -196
  1095. data/lib/Ice/LocatorF.rb +0 -30
  1096. data/lib/Ice/Logger.rb +0 -24
  1097. data/lib/Ice/LoggerF.rb +0 -24
  1098. data/lib/Ice/Metrics.rb +0 -337
  1099. data/lib/Ice/ObjectAdapter.rb +0 -29
  1100. data/lib/Ice/ObjectAdapterF.rb +0 -24
  1101. data/lib/Ice/ObjectFactory.rb +0 -24
  1102. data/lib/Ice/Plugin.rb +0 -30
  1103. data/lib/Ice/PluginF.rb +0 -28
  1104. data/lib/Ice/Process.rb +0 -53
  1105. data/lib/Ice/ProcessF.rb +0 -25
  1106. data/lib/Ice/Properties.rb +0 -25
  1107. data/lib/Ice/PropertiesAdmin.rb +0 -63
  1108. data/lib/Ice/PropertiesF.rb +0 -29
  1109. data/lib/Ice/RemoteLogger.rb +0 -207
  1110. data/lib/Ice/Router.rb +0 -87
  1111. data/lib/Ice/RouterF.rb +0 -25
  1112. data/lib/Ice/ServantLocator.rb +0 -26
  1113. data/lib/Ice/ServantLocatorF.rb +0 -24
  1114. data/lib/Ice/SliceChecksumDict.rb +0 -24
  1115. data/lib/Ice/ValueFactory.rb +0 -28
  1116. data/lib/Ice/Version.rb +0 -90
  1117. data/lib/Ice.rb +0 -673
  1118. data/lib/IceBox/IceBox.rb +0 -164
  1119. data/lib/IceBox.rb +0 -5
  1120. data/lib/IceGrid/Admin.rb +0 -1196
  1121. data/lib/IceGrid/Descriptor.rb +0 -1034
  1122. data/lib/IceGrid/Exception.rb +0 -376
  1123. data/lib/IceGrid/FileParser.rb +0 -65
  1124. data/lib/IceGrid/PluginFacade.rb +0 -35
  1125. data/lib/IceGrid/Registry.rb +0 -209
  1126. data/lib/IceGrid/Session.rb +0 -71
  1127. data/lib/IceGrid/UserAccountMapper.rb +0 -61
  1128. data/lib/IceGrid.rb +0 -9
  1129. data/lib/IcePatch2/FileInfo.rb +0 -115
  1130. data/lib/IcePatch2/FileServer.rb +0 -123
  1131. data/lib/IcePatch2.rb +0 -5
  1132. data/lib/IceStorm/IceStorm.rb +0 -332
  1133. data/lib/IceStorm/Metrics.rb +0 -73
  1134. data/lib/IceStorm.rb +0 -6
  1135. data/slice/Glacier2/Metrics.ice +0 -88
  1136. data/slice/Glacier2/PermissionsVerifier.ice +0 -111
  1137. data/slice/Glacier2/PermissionsVerifierF.ice +0 -30
  1138. data/slice/Glacier2/Router.ice +0 -186
  1139. data/slice/Glacier2/RouterF.ice +0 -29
  1140. data/slice/Glacier2/SSLInfo.ice +0 -59
  1141. data/slice/Glacier2/Session.ice +0 -274
  1142. data/slice/Ice/BuiltinSequences.ice +0 -59
  1143. data/slice/Ice/Communicator.ice +0 -676
  1144. data/slice/Ice/CommunicatorF.ice +0 -31
  1145. data/slice/Ice/Connection.ice +0 -516
  1146. data/slice/Ice/ConnectionF.ice +0 -33
  1147. data/slice/Ice/Current.ice +0 -170
  1148. data/slice/Ice/Endpoint.ice +0 -291
  1149. data/slice/Ice/EndpointF.ice +0 -43
  1150. data/slice/Ice/EndpointTypes.ice +0 -48
  1151. data/slice/Ice/FacetMap.ice +0 -36
  1152. data/slice/Ice/Identity.ice +0 -75
  1153. data/slice/Ice/ImplicitContext.ice +0 -119
  1154. data/slice/Ice/ImplicitContextF.ice +0 -30
  1155. data/slice/Ice/Instrumentation.ice +0 -509
  1156. data/slice/Ice/InstrumentationF.ice +0 -38
  1157. data/slice/Ice/LocalException.ice +0 -1040
  1158. data/slice/Ice/Locator.ice +0 -239
  1159. data/slice/Ice/LocatorF.ice +0 -32
  1160. data/slice/Ice/Logger.ice +0 -99
  1161. data/slice/Ice/LoggerF.ice +0 -31
  1162. data/slice/Ice/Metrics.ice +0 -436
  1163. data/slice/Ice/ObjectAdapter.ice +0 -710
  1164. data/slice/Ice/ObjectAdapterF.ice +0 -31
  1165. data/slice/Ice/ObjectFactory.ice +0 -71
  1166. data/slice/Ice/Plugin.ice +0 -131
  1167. data/slice/Ice/PluginF.ice +0 -36
  1168. data/slice/Ice/Process.ice +0 -64
  1169. data/slice/Ice/ProcessF.ice +0 -31
  1170. data/slice/Ice/Properties.ice +0 -244
  1171. data/slice/Ice/PropertiesAdmin.ice +0 -87
  1172. data/slice/Ice/PropertiesF.ice +0 -32
  1173. data/slice/Ice/RemoteLogger.ice +0 -226
  1174. data/slice/Ice/Router.ice +0 -103
  1175. data/slice/Ice/RouterF.ice +0 -31
  1176. data/slice/Ice/ServantLocator.ice +0 -136
  1177. data/slice/Ice/ServantLocatorF.ice +0 -31
  1178. data/slice/Ice/SliceChecksumDict.ice +0 -36
  1179. data/slice/Ice/ValueFactory.ice +0 -133
  1180. data/slice/Ice/Version.ice +0 -51
  1181. data/slice/IceBT/ConnectionInfo.ice +0 -59
  1182. data/slice/IceBT/EndpointInfo.ice +0 -57
  1183. data/slice/IceBT/Types.ice +0 -45
  1184. data/slice/IceBox/IceBox.ice +0 -216
  1185. data/slice/IceDiscovery/IceDiscovery.ice +0 -98
  1186. data/slice/IceGrid/Admin.ice +0 -1957
  1187. data/slice/IceGrid/Descriptor.ice +0 -1094
  1188. data/slice/IceGrid/Exception.ice +0 -396
  1189. data/slice/IceGrid/FileParser.ice +0 -72
  1190. data/slice/IceGrid/PluginFacade.ice +0 -329
  1191. data/slice/IceGrid/Registry.ice +0 -269
  1192. data/slice/IceGrid/Session.ice +0 -128
  1193. data/slice/IceGrid/UserAccountMapper.ice +0 -69
  1194. data/slice/IceIAP/ConnectionInfo.ice +0 -74
  1195. data/slice/IceIAP/EndpointInfo.ice +0 -68
  1196. data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +0 -83
  1197. data/slice/IcePatch2/FileInfo.ice +0 -85
  1198. data/slice/IcePatch2/FileServer.ice +0 -191
  1199. data/slice/IceSSL/ConnectionInfo.ice +0 -54
  1200. data/slice/IceSSL/ConnectionInfoF.ice +0 -31
  1201. data/slice/IceSSL/EndpointInfo.ice +0 -45
  1202. data/slice/IceStorm/IceStorm.ice +0 -414
  1203. data/slice/IceStorm/Metrics.ice +0 -83
  1204. /data/{ext → dist}/ice/mcpp/config.h +0 -0
  1205. /data/{ext → dist}/ice/mcpp/configed.H +0 -0
  1206. /data/{ext → dist}/ice/mcpp/directive.c +0 -0
  1207. /data/{ext → dist}/ice/mcpp/eval.c +0 -0
  1208. /data/{ext → dist}/ice/mcpp/expand.c +0 -0
  1209. /data/{ext → dist}/ice/mcpp/mbchar.c +0 -0
  1210. /data/{ext → dist}/ice/mcpp/mcpp_lib.h +0 -0
  1211. /data/{ext/ice/mcpp/main.c → dist/ice/mcpp/mcpp_main.c} +0 -0
  1212. /data/{ext → dist}/ice/mcpp/mcpp_out.h +0 -0
  1213. /data/{ext → dist}/ice/mcpp/support.c +0 -0
  1214. /data/{ext → dist}/ice/mcpp/system.H +0 -0
  1215. /data/{ext → dist}/ice/mcpp/system.c +0 -0
@@ -0,0 +1,3563 @@
1
+ // Copyright (c) ZeroC, Inc.
2
+
3
+ #include "ConnectionI.h"
4
+ #include "BatchRequestQueue.h"
5
+ #include "CheckIdentity.h"
6
+ #include "Endian.h"
7
+ #include "EndpointI.h"
8
+ #include "Ice/IncomingRequest.h"
9
+ #include "Ice/LocalExceptions.h"
10
+ #include "Ice/LoggerUtil.h"
11
+ #include "Ice/OutgoingResponse.h"
12
+ #include "Ice/Properties.h"
13
+ #include "IdleTimeoutTransceiverDecorator.h"
14
+ #include "Instance.h"
15
+ #include "ObjectAdapterI.h" // For getThreadPool()
16
+ #include "ReferenceFactory.h" // For createProxy().
17
+ #include "RequestHandler.h" // For RetryException
18
+ #include "ThreadPool.h"
19
+ #include "TraceLevels.h"
20
+ #include "TraceUtil.h"
21
+ #include "Transceiver.h"
22
+
23
+ #include "DisableWarnings.h"
24
+
25
+ #include <algorithm>
26
+ #include <iomanip>
27
+ #include <stdexcept>
28
+
29
+ #ifdef ICE_HAS_BZIP2
30
+ # include <bzlib.h>
31
+ #endif
32
+
33
+ using namespace std;
34
+ using namespace Ice;
35
+ using namespace Ice::Instrumentation;
36
+ using namespace IceInternal;
37
+
38
+ namespace
39
+ {
40
+ class ConnectTimerTask final : public TimerTask
41
+ {
42
+ public:
43
+ ConnectTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {}
44
+
45
+ void runTimerTask() final
46
+ {
47
+ if (auto connection = _connection.lock())
48
+ {
49
+ connection->connectTimedOut();
50
+ }
51
+ }
52
+
53
+ private:
54
+ const weak_ptr<Ice::ConnectionI> _connection;
55
+ };
56
+
57
+ class CloseTimerTask final : public TimerTask
58
+ {
59
+ public:
60
+ CloseTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {}
61
+
62
+ void runTimerTask() final
63
+ {
64
+ if (auto connection = _connection.lock())
65
+ {
66
+ connection->closeTimedOut();
67
+ }
68
+ }
69
+
70
+ private:
71
+ const weak_ptr<Ice::ConnectionI> _connection;
72
+ };
73
+
74
+ class InactivityTimerTask final : public TimerTask
75
+ {
76
+ public:
77
+ InactivityTimerTask(const Ice::ConnectionIPtr& connection) : _connection(connection) {}
78
+
79
+ void runTimerTask() final
80
+ {
81
+ if (auto connection = _connection.lock())
82
+ {
83
+ connection->inactivityCheck();
84
+ }
85
+ }
86
+
87
+ private:
88
+ const weak_ptr<Ice::ConnectionI> _connection;
89
+ };
90
+
91
+ //
92
+ // Class for handling Ice::Connection::begin_flushBatchRequests
93
+ //
94
+ class ConnectionFlushBatchAsync : public OutgoingAsyncBase
95
+ {
96
+ public:
97
+ ConnectionFlushBatchAsync(Ice::ConnectionIPtr, const InstancePtr&);
98
+
99
+ [[nodiscard]] virtual Ice::ConnectionPtr getConnection() const;
100
+
101
+ void invoke(std::string_view, Ice::CompressBatch);
102
+
103
+ private:
104
+ const Ice::ConnectionIPtr _connection;
105
+ };
106
+
107
+ ConnectionState connectionStateMap[] = {
108
+ ConnectionState::ConnectionStateValidating, // StateNotInitialized
109
+ ConnectionState::ConnectionStateValidating, // StateNotValidated
110
+ ConnectionState::ConnectionStateActive, // StateActive
111
+ ConnectionState::ConnectionStateHolding, // StateHolding
112
+ ConnectionState::ConnectionStateClosing, // StateClosing
113
+ ConnectionState::ConnectionStateClosing, // StateClosingPending
114
+ ConnectionState::ConnectionStateClosed, // StateClosed
115
+ ConnectionState::ConnectionStateClosed, // StateFinished
116
+ };
117
+
118
+ string createBadMagicMessage(const byte m[])
119
+ {
120
+ ostringstream os;
121
+ os << "bag magic in message header: ";
122
+ for (size_t i = 0; i < sizeof(magic); ++i)
123
+ {
124
+ os << hex << setw(2) << setfill('0') << static_cast<int>(m[i]) << ' ';
125
+ }
126
+ return os.str();
127
+ }
128
+ }
129
+
130
+ ConnectionFlushBatchAsync::ConnectionFlushBatchAsync(ConnectionIPtr connection, const InstancePtr& instance)
131
+ : OutgoingAsyncBase(instance),
132
+ _connection(std::move(connection))
133
+ {
134
+ }
135
+
136
+ ConnectionPtr
137
+ ConnectionFlushBatchAsync::getConnection() const
138
+ {
139
+ return _connection;
140
+ }
141
+
142
+ void
143
+ ConnectionFlushBatchAsync::invoke(string_view operation, Ice::CompressBatch compressBatch)
144
+ {
145
+ _observer.attach(_instance.get(), operation);
146
+ try
147
+ {
148
+ AsyncStatus status;
149
+ bool compress;
150
+ int batchRequestCount = _connection->getBatchRequestQueue()->swap(&_os, compress);
151
+ if (batchRequestCount == 0)
152
+ {
153
+ status = AsyncStatusSent;
154
+ if (sent())
155
+ {
156
+ status = static_cast<AsyncStatus>(status | AsyncStatusInvokeSentCallback);
157
+ }
158
+ }
159
+ else
160
+ {
161
+ if (compressBatch == CompressBatch::Yes)
162
+ {
163
+ compress = true;
164
+ }
165
+ else if (compressBatch == CompressBatch::No)
166
+ {
167
+ compress = false;
168
+ }
169
+ status = _connection->sendAsyncRequest(shared_from_this(), compress, false, batchRequestCount);
170
+ }
171
+
172
+ if (status & AsyncStatusSent)
173
+ {
174
+ _sentSynchronously = true;
175
+ if (status & AsyncStatusInvokeSentCallback)
176
+ {
177
+ invokeSent();
178
+ }
179
+ }
180
+ }
181
+ catch (const RetryException& ex)
182
+ {
183
+ try
184
+ {
185
+ rethrow_exception(ex.get());
186
+ }
187
+ catch (const std::exception&)
188
+ {
189
+ if (exception(current_exception()))
190
+ {
191
+ invokeExceptionAsync();
192
+ }
193
+ }
194
+ }
195
+ catch (const Exception&)
196
+ {
197
+ if (exception(current_exception()))
198
+ {
199
+ invokeExceptionAsync();
200
+ }
201
+ }
202
+ }
203
+
204
+ Ice::ConnectionI::Observer::Observer() = default;
205
+
206
+ void
207
+ Ice::ConnectionI::Observer::startRead(const Buffer& buf)
208
+ {
209
+ if (_readStreamPos)
210
+ {
211
+ assert(!buf.b.empty());
212
+ _observer->receivedBytes(static_cast<int>(buf.i - _readStreamPos));
213
+ }
214
+ _readStreamPos = buf.b.empty() ? nullptr : buf.i;
215
+ }
216
+
217
+ void
218
+ Ice::ConnectionI::Observer::finishRead(const Buffer& buf)
219
+ {
220
+ if (_readStreamPos == nullptr)
221
+ {
222
+ return;
223
+ }
224
+ assert(buf.i >= _readStreamPos);
225
+ _observer->receivedBytes(static_cast<int>(buf.i - _readStreamPos));
226
+ _readStreamPos = nullptr;
227
+ }
228
+
229
+ void
230
+ Ice::ConnectionI::Observer::startWrite(const Buffer& buf)
231
+ {
232
+ if (_writeStreamPos)
233
+ {
234
+ assert(!buf.b.empty());
235
+ _observer->sentBytes(static_cast<int>(buf.i - _writeStreamPos));
236
+ }
237
+ _writeStreamPos = buf.b.empty() ? nullptr : buf.i;
238
+ }
239
+
240
+ void
241
+ Ice::ConnectionI::Observer::finishWrite(const Buffer& buf)
242
+ {
243
+ if (_writeStreamPos == nullptr)
244
+ {
245
+ return;
246
+ }
247
+ if (buf.i > _writeStreamPos)
248
+ {
249
+ _observer->sentBytes(static_cast<int>(buf.i - _writeStreamPos));
250
+ }
251
+ _writeStreamPos = nullptr;
252
+ }
253
+
254
+ void
255
+ Ice::ConnectionI::Observer::attach(const Ice::Instrumentation::ConnectionObserverPtr& observer)
256
+ {
257
+ ObserverHelperT<Ice::Instrumentation::ConnectionObserver>::attach(observer);
258
+ if (!observer)
259
+ {
260
+ _writeStreamPos = nullptr;
261
+ _readStreamPos = nullptr;
262
+ }
263
+ }
264
+
265
+ void
266
+ Ice::ConnectionI::OutgoingMessage::adopt(OutputStream* str)
267
+ {
268
+ if (adopted)
269
+ {
270
+ if (str)
271
+ {
272
+ delete stream;
273
+ stream = nullptr;
274
+ adopted = false;
275
+ }
276
+ else
277
+ {
278
+ return; // Stream is already adopted.
279
+ }
280
+ }
281
+ else if (!str)
282
+ {
283
+ if (outAsync)
284
+ {
285
+ return; // Adopting request stream is not necessary.
286
+ }
287
+ else
288
+ {
289
+ str = stream; // Adopt this stream
290
+ stream = nullptr;
291
+ }
292
+ }
293
+
294
+ assert(str);
295
+ assert(str->b.ownsMemory());
296
+ stream = new OutputStream(std::move(*str));
297
+ adopted = true;
298
+ }
299
+
300
+ void
301
+ Ice::ConnectionI::OutgoingMessage::canceled(bool adoptStream)
302
+ {
303
+ assert(outAsync); // Only requests can timeout.
304
+ outAsync = nullptr;
305
+ if (adoptStream)
306
+ {
307
+ adopt(nullptr); // Adopt the request stream
308
+ }
309
+ else
310
+ {
311
+ assert(!adopted);
312
+ }
313
+ }
314
+
315
+ bool
316
+ Ice::ConnectionI::OutgoingMessage::sent()
317
+ {
318
+ // This function is called with the connection mutex locked.
319
+
320
+ if (adopted)
321
+ {
322
+ delete stream;
323
+ }
324
+ stream = nullptr;
325
+
326
+ if (outAsync)
327
+ {
328
+ #if defined(ICE_USE_IOCP)
329
+ invokeSent = outAsync->sent();
330
+ return invokeSent || receivedReply;
331
+ #else
332
+ return outAsync->sent();
333
+ #endif
334
+ }
335
+ return false;
336
+ }
337
+
338
+ void
339
+ Ice::ConnectionI::OutgoingMessage::completed(std::exception_ptr ex)
340
+ {
341
+ if (outAsync)
342
+ {
343
+ if (outAsync->exception(ex))
344
+ {
345
+ outAsync->invokeException();
346
+ }
347
+ }
348
+
349
+ if (adopted)
350
+ {
351
+ delete stream;
352
+ }
353
+ stream = nullptr;
354
+ }
355
+
356
+ void
357
+ Ice::ConnectionI::startAsync(
358
+ function<void(const ConnectionIPtr&)> connectionStartCompleted,
359
+ function<void(const ConnectionIPtr&, exception_ptr)> connectionStartFailed)
360
+ {
361
+ try
362
+ {
363
+ std::unique_lock lock(_mutex);
364
+ if (_state >= StateClosed) // The connection might already be closed if the communicator was destroyed.
365
+ {
366
+ assert(_exception);
367
+ rethrow_exception(_exception);
368
+ }
369
+
370
+ if (!initialize() || !validate())
371
+ {
372
+ if (_connectTimeout > chrono::seconds::zero())
373
+ {
374
+ _timer->schedule(make_shared<ConnectTimerTask>(shared_from_this()), _connectTimeout);
375
+ }
376
+
377
+ if (connectionStartCompleted && connectionStartFailed)
378
+ {
379
+ _connectionStartCompleted = std::move(connectionStartCompleted);
380
+ _connectionStartFailed = std::move(connectionStartFailed);
381
+ return;
382
+ }
383
+
384
+ //
385
+ // Wait for the connection to be validated.
386
+ //
387
+ _conditionVariable.wait(lock, [this] { return _state > StateNotValidated; });
388
+
389
+ if (_state >= StateClosing)
390
+ {
391
+ assert(_exception);
392
+ rethrow_exception(_exception);
393
+ }
394
+ }
395
+
396
+ //
397
+ // We start out in holding state.
398
+ //
399
+ setState(StateHolding);
400
+ }
401
+ catch (const Ice::LocalException&)
402
+ {
403
+ exception(current_exception());
404
+ if (connectionStartFailed)
405
+ {
406
+ connectionStartFailed(shared_from_this(), current_exception());
407
+ return;
408
+ }
409
+ else
410
+ {
411
+ waitUntilFinished();
412
+ throw;
413
+ }
414
+ }
415
+
416
+ if (connectionStartCompleted)
417
+ {
418
+ connectionStartCompleted(shared_from_this());
419
+ }
420
+ }
421
+
422
+ void
423
+ Ice::ConnectionI::activate()
424
+ {
425
+ std::lock_guard lock(_mutex);
426
+ if (_state <= StateNotValidated)
427
+ {
428
+ return;
429
+ }
430
+ setState(StateActive);
431
+ }
432
+
433
+ void
434
+ Ice::ConnectionI::hold()
435
+ {
436
+ std::lock_guard lock(_mutex);
437
+ if (_state <= StateNotValidated)
438
+ {
439
+ return;
440
+ }
441
+
442
+ setState(StateHolding);
443
+ }
444
+
445
+ void
446
+ Ice::ConnectionI::destroy(DestructionReason reason)
447
+ {
448
+ std::lock_guard lock(_mutex);
449
+
450
+ switch (reason)
451
+ {
452
+ case ObjectAdapterDeactivated:
453
+ {
454
+ setState(
455
+ StateClosing,
456
+ make_exception_ptr(
457
+ ObjectAdapterDeactivatedException{__FILE__, __LINE__, _adapter ? _adapter->getName() : ""}));
458
+ break;
459
+ }
460
+
461
+ case CommunicatorDestroyed:
462
+ {
463
+ setState(StateClosing, make_exception_ptr(CommunicatorDestroyedException{__FILE__, __LINE__}));
464
+ break;
465
+ }
466
+ }
467
+ }
468
+
469
+ void
470
+ Ice::ConnectionI::abort() noexcept
471
+ {
472
+ std::lock_guard lock(_mutex);
473
+ setState(
474
+ StateClosed,
475
+ make_exception_ptr(
476
+ ConnectionAbortedException{__FILE__, __LINE__, "connection aborted by the application", true}));
477
+ }
478
+
479
+ void
480
+ Ice::ConnectionI::close(function<void()> response, function<void(std::exception_ptr)> exception) noexcept
481
+ {
482
+ std::exception_ptr closeException = nullptr;
483
+ {
484
+ std::lock_guard lock(_mutex);
485
+ if (_state >= StateClosed)
486
+ {
487
+ closeException = _exception;
488
+ assert(closeException);
489
+ }
490
+ else
491
+ {
492
+ if (response || exception)
493
+ {
494
+ _onClosedList.emplace_back(std::move(response), std::move(exception));
495
+ }
496
+
497
+ if (_state < StateClosing)
498
+ {
499
+ if (_asyncRequests.empty())
500
+ {
501
+ doApplicationClose();
502
+ }
503
+ else
504
+ {
505
+ // We'll close the connection when we get the last reply message.
506
+ _closeRequested = true;
507
+ scheduleCloseTimerTask(); // we don't want to wait forever
508
+ }
509
+ }
510
+ // else nothing to do
511
+ }
512
+ }
513
+
514
+ if ((response || exception) && closeException) // already closed
515
+ {
516
+ bool success = false;
517
+ try
518
+ {
519
+ rethrow_exception(closeException);
520
+ }
521
+ catch (const ConnectionClosedException&)
522
+ {
523
+ success = true;
524
+ }
525
+ catch (const CloseConnectionException&)
526
+ {
527
+ success = true;
528
+ }
529
+ catch (const CommunicatorDestroyedException&)
530
+ {
531
+ success = true;
532
+ }
533
+ catch (const ObjectAdapterDeactivatedException&)
534
+ {
535
+ success = true;
536
+ }
537
+ catch (const ObjectAdapterDestroyedException&)
538
+ {
539
+ success = true;
540
+ }
541
+ catch (...)
542
+ {
543
+ }
544
+
545
+ if (success)
546
+ {
547
+ if (response)
548
+ {
549
+ response();
550
+ }
551
+ }
552
+ else
553
+ {
554
+ if (exception)
555
+ {
556
+ exception(closeException);
557
+ }
558
+ }
559
+ }
560
+ }
561
+
562
+ bool
563
+ Ice::ConnectionI::isActiveOrHolding() const
564
+ {
565
+ // We can not use trylock here, otherwise the outgoing connection
566
+ // factory might return destroyed (closing or closed) connections,
567
+ // resulting in connection retry exhaustion.
568
+
569
+ std::lock_guard lock(_mutex);
570
+
571
+ return _state > StateNotValidated && _state < StateClosing;
572
+ }
573
+
574
+ bool
575
+ Ice::ConnectionI::isFinished() const
576
+ {
577
+ //
578
+ // We can use trylock here, because as long as there are still
579
+ // threads operating in this connection object, connection
580
+ // destruction is considered as not yet finished.
581
+ //
582
+ std::unique_lock<std::mutex> lock(_mutex, std::try_to_lock);
583
+
584
+ if (!lock.owns_lock())
585
+ {
586
+ return false;
587
+ }
588
+
589
+ if (_state != StateFinished || _upcallCount != 0)
590
+ {
591
+ return false;
592
+ }
593
+
594
+ assert(_state == StateFinished);
595
+ return true;
596
+ }
597
+
598
+ void
599
+ Ice::ConnectionI::throwException() const
600
+ {
601
+ std::lock_guard lock(_mutex);
602
+
603
+ if (_exception)
604
+ {
605
+ assert(_state >= StateClosing);
606
+ rethrow_exception(_exception);
607
+ }
608
+ }
609
+
610
+ void
611
+ Ice::ConnectionI::waitUntilHolding() const
612
+ {
613
+ std::unique_lock lock(_mutex);
614
+ _conditionVariable.wait(lock, [this] { return _state >= StateHolding && _upcallCount == 0; });
615
+ }
616
+
617
+ void
618
+ Ice::ConnectionI::waitUntilFinished()
619
+ {
620
+ std::unique_lock lock(_mutex);
621
+
622
+ //
623
+ // We wait indefinitely until the connection is finished and all
624
+ // outstanding requests are completed. Otherwise we couldn't
625
+ // guarantee that there are no outstanding calls when deactivate()
626
+ // is called on the servant locators.
627
+ //
628
+ _conditionVariable.wait(lock, [this] { return _state >= StateFinished && _upcallCount == 0; });
629
+
630
+ assert(_state == StateFinished);
631
+
632
+ //
633
+ // Clear the OA. See bug 1673 for the details of why this is necessary.
634
+ //
635
+ _adapter = nullptr;
636
+ }
637
+
638
+ void
639
+ Ice::ConnectionI::updateObserver()
640
+ {
641
+ std::lock_guard lock(_mutex);
642
+ if (_state < StateNotValidated || _state > StateClosed)
643
+ {
644
+ return;
645
+ }
646
+
647
+ assert(_instance->initializationData().observer);
648
+
649
+ ConnectionObserverPtr o = _instance->initializationData().observer->getConnectionObserver(
650
+ initConnectionInfo(),
651
+ _endpoint,
652
+ toConnectionState(_state),
653
+ _observer.get());
654
+ _observer.attach(o);
655
+ }
656
+
657
+ AsyncStatus
658
+ Ice::ConnectionI::sendAsyncRequest(const OutgoingAsyncBasePtr& out, bool compress, bool response, int batchRequestCount)
659
+ {
660
+ OutputStream* os = out->getOs();
661
+
662
+ std::lock_guard lock(_mutex);
663
+ //
664
+ // If the exception is closed before we even have a chance
665
+ // to send our request, we always try to send the request
666
+ // again.
667
+ //
668
+ if (_exception)
669
+ {
670
+ throw RetryException(_exception);
671
+ }
672
+ assert(_state > StateNotValidated);
673
+ assert(_state < StateClosing);
674
+
675
+ //
676
+ // Ensure the message isn't bigger than what we can send with the
677
+ // transport.
678
+ //
679
+ _transceiver->checkSendSize(*os);
680
+
681
+ //
682
+ // Notify the request that it's cancelable with this connection.
683
+ // This will throw if the request is canceled.
684
+ //
685
+ out->cancelable(shared_from_this());
686
+ int32_t requestId = 0;
687
+ if (response)
688
+ {
689
+ //
690
+ // Create a new unique request ID.
691
+ //
692
+ requestId = _nextRequestId++;
693
+ if (requestId <= 0)
694
+ {
695
+ _nextRequestId = 1;
696
+ requestId = _nextRequestId++;
697
+ }
698
+
699
+ //
700
+ // Fill in the request ID.
701
+ //
702
+ const byte* p = reinterpret_cast<const byte*>(&requestId);
703
+ if constexpr (endian::native == endian::big)
704
+ {
705
+ reverse_copy(p, p + sizeof(int32_t), os->b.begin() + headerSize);
706
+ }
707
+ else
708
+ {
709
+ copy(p, p + sizeof(int32_t), os->b.begin() + headerSize);
710
+ }
711
+ }
712
+ else if (batchRequestCount > 0)
713
+ {
714
+ const byte* p = reinterpret_cast<const byte*>(&batchRequestCount);
715
+ if constexpr (endian::native == endian::big)
716
+ {
717
+ reverse_copy(p, p + sizeof(int32_t), os->b.begin() + headerSize);
718
+ }
719
+ else
720
+ {
721
+ copy(p, p + sizeof(int32_t), os->b.begin() + headerSize);
722
+ }
723
+ }
724
+
725
+ out->attachRemoteObserver(initConnectionInfo(), _endpoint, requestId);
726
+
727
+ // We're just about to send a request, so we are not inactive anymore.
728
+ cancelInactivityTimerTask();
729
+
730
+ AsyncStatus status = AsyncStatusQueued;
731
+ try
732
+ {
733
+ OutgoingMessage message(out, os, compress, requestId);
734
+ status = sendMessage(message);
735
+ }
736
+ catch (const LocalException&)
737
+ {
738
+ setState(StateClosed, current_exception());
739
+ assert(_exception);
740
+ rethrow_exception(_exception);
741
+ }
742
+
743
+ if (response)
744
+ {
745
+ _asyncRequestsHint =
746
+ _asyncRequests.insert(_asyncRequests.end(), pair<const int32_t, OutgoingAsyncBasePtr>(requestId, out));
747
+ }
748
+ return status;
749
+ }
750
+
751
+ const BatchRequestQueuePtr&
752
+ Ice::ConnectionI::getBatchRequestQueue() const
753
+ {
754
+ return _batchRequestQueue;
755
+ }
756
+
757
+ std::function<void()>
758
+ Ice::ConnectionI::flushBatchRequestsAsync(
759
+ CompressBatch compress,
760
+ std::function<void(std::exception_ptr)> ex,
761
+ std::function<void(bool)> sent)
762
+ {
763
+ class ConnectionFlushBatchLambda : public ConnectionFlushBatchAsync, public LambdaInvoke
764
+ {
765
+ public:
766
+ ConnectionFlushBatchLambda(
767
+ std::shared_ptr<Ice::ConnectionI>&& connection,
768
+ const InstancePtr& instance,
769
+ std::function<void(std::exception_ptr)> ex,
770
+ std::function<void(bool)> sent)
771
+ : ConnectionFlushBatchAsync(connection, instance),
772
+ LambdaInvoke(std::move(ex), std::move(sent))
773
+ {
774
+ }
775
+ };
776
+ auto outAsync = make_shared<ConnectionFlushBatchLambda>(shared_from_this(), _instance, ex, sent);
777
+ static constexpr string_view operationName = "flushBatchRequests";
778
+ outAsync->invoke(operationName, compress);
779
+ return [outAsync]() { outAsync->cancel(); };
780
+ }
781
+
782
+ void
783
+ Ice::ConnectionI::setCloseCallback(CloseCallback callback)
784
+ {
785
+ std::lock_guard lock(_mutex);
786
+ if (_state >= StateClosed)
787
+ {
788
+ if (callback)
789
+ {
790
+ auto self = shared_from_this();
791
+ _threadPool->execute([self, callback = std::move(callback)]() { self->closeCallback(callback); }, self);
792
+ }
793
+ }
794
+ else
795
+ {
796
+ _closeCallback = std::move(callback);
797
+ }
798
+ }
799
+
800
+ void
801
+ Ice::ConnectionI::disableInactivityCheck() noexcept
802
+ {
803
+ std::lock_guard lock{_mutex};
804
+ cancelInactivityTimerTask();
805
+ _inactivityTimerTask = nullptr;
806
+ }
807
+
808
+ void
809
+ Ice::ConnectionI::closeCallback(const CloseCallback& callback)
810
+ {
811
+ try
812
+ {
813
+ callback(shared_from_this());
814
+ }
815
+ catch (const std::exception& ex)
816
+ {
817
+ Error out(_instance->initializationData().logger);
818
+ out << "connection callback exception:\n" << ex << '\n' << _desc;
819
+ }
820
+ catch (...)
821
+ {
822
+ Error out(_instance->initializationData().logger);
823
+ out << "connection callback exception:\nunknown c++ exception" << '\n' << _desc;
824
+ }
825
+ }
826
+
827
+ void
828
+ Ice::ConnectionI::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync, exception_ptr ex)
829
+ {
830
+ //
831
+ // NOTE: This isn't called from a thread pool thread.
832
+ //
833
+
834
+ std::lock_guard lock(_mutex);
835
+ if (_state >= StateClosed)
836
+ {
837
+ return; // The request has already been or will be shortly notified of the failure.
838
+ }
839
+
840
+ for (auto o = _sendStreams.begin(); o != _sendStreams.end(); ++o)
841
+ {
842
+ if (o->outAsync.get() == outAsync.get())
843
+ {
844
+ if (o->requestId)
845
+ {
846
+ if (_asyncRequestsHint != _asyncRequests.end() &&
847
+ _asyncRequestsHint->second == dynamic_pointer_cast<OutgoingAsync>(outAsync))
848
+ {
849
+ _asyncRequests.erase(_asyncRequestsHint);
850
+ _asyncRequestsHint = _asyncRequests.end();
851
+ }
852
+ else
853
+ {
854
+ _asyncRequests.erase(o->requestId);
855
+ }
856
+ }
857
+
858
+ try
859
+ {
860
+ rethrow_exception(ex);
861
+ }
862
+ catch (const ConnectionAbortedException&)
863
+ {
864
+ setState(StateClosed, ex);
865
+ }
866
+ catch (const std::exception&)
867
+ {
868
+ //
869
+ // If the request is being sent, don't remove it from the send streams,
870
+ // it will be removed once the sending is finished.
871
+ //
872
+ if (o == _sendStreams.begin())
873
+ {
874
+ o->canceled(true); // true = adopt the stream
875
+ }
876
+ else
877
+ {
878
+ o->canceled(false);
879
+ _sendStreams.erase(o);
880
+ }
881
+ if (outAsync->exception(ex))
882
+ {
883
+ outAsync->invokeExceptionAsync();
884
+ }
885
+ }
886
+
887
+ if (_closeRequested && _state < StateClosing && _asyncRequests.empty())
888
+ {
889
+ doApplicationClose();
890
+ }
891
+ return;
892
+ }
893
+ }
894
+
895
+ if (dynamic_pointer_cast<OutgoingAsync>(outAsync))
896
+ {
897
+ if (_asyncRequestsHint != _asyncRequests.end())
898
+ {
899
+ if (_asyncRequestsHint->second == outAsync)
900
+ {
901
+ try
902
+ {
903
+ rethrow_exception(ex);
904
+ }
905
+ catch (const ConnectionAbortedException&)
906
+ {
907
+ setState(StateClosed, ex);
908
+ }
909
+ catch (const std::exception&)
910
+ {
911
+ _asyncRequests.erase(_asyncRequestsHint);
912
+ _asyncRequestsHint = _asyncRequests.end();
913
+
914
+ if (outAsync->exception(ex))
915
+ {
916
+ outAsync->invokeExceptionAsync();
917
+ }
918
+ }
919
+
920
+ if (_closeRequested && _state < StateClosing && _asyncRequests.empty())
921
+ {
922
+ doApplicationClose();
923
+ }
924
+ return;
925
+ }
926
+ }
927
+
928
+ for (auto p = _asyncRequests.begin(); p != _asyncRequests.end(); ++p)
929
+ {
930
+ if (p->second.get() == outAsync.get())
931
+ {
932
+ try
933
+ {
934
+ rethrow_exception(ex);
935
+ }
936
+ catch (const ConnectionAbortedException&)
937
+ {
938
+ setState(StateClosed, ex);
939
+ }
940
+ catch (const std::exception&)
941
+ {
942
+ assert(p != _asyncRequestsHint);
943
+ _asyncRequests.erase(p);
944
+
945
+ if (outAsync->exception(ex))
946
+ {
947
+ outAsync->invokeExceptionAsync();
948
+ }
949
+ }
950
+ return;
951
+ }
952
+ }
953
+ }
954
+ }
955
+
956
+ void
957
+ Ice::ConnectionI::dispatchException(exception_ptr ex, int requestCount)
958
+ {
959
+ // Fatal exception while dispatching a request. Since sendResponse isn't called in case of a fatal exception we
960
+ // decrement _upcallCount here.
961
+
962
+ bool finished = false;
963
+ {
964
+ std::lock_guard lock(_mutex);
965
+ setState(StateClosed, ex);
966
+
967
+ if (requestCount > 0)
968
+ {
969
+ assert(_upcallCount >= requestCount);
970
+ _upcallCount -= requestCount;
971
+ if (_upcallCount == 0)
972
+ {
973
+ if (_state == StateFinished)
974
+ {
975
+ finished = true;
976
+ if (_observer)
977
+ {
978
+ _observer.detach();
979
+ }
980
+ }
981
+ _conditionVariable.notify_all();
982
+ }
983
+ }
984
+ }
985
+ if (finished && _removeFromFactory)
986
+ {
987
+ _removeFromFactory(shared_from_this());
988
+ }
989
+ }
990
+
991
+ EndpointIPtr
992
+ Ice::ConnectionI::endpoint() const
993
+ {
994
+ return _endpoint; // No mutex protection necessary, _endpoint is immutable.
995
+ }
996
+
997
+ ConnectorPtr
998
+ Ice::ConnectionI::connector() const
999
+ {
1000
+ return _connector; // No mutex protection necessary, _connector is immutable.
1001
+ }
1002
+
1003
+ void
1004
+ Ice::ConnectionI::setAdapter(const ObjectAdapterPtr& adapter)
1005
+ {
1006
+ if (!_connector) // server connection
1007
+ {
1008
+ throw std::logic_error{"setAdapter can only be called on a client connection"};
1009
+ }
1010
+
1011
+ if (adapter)
1012
+ {
1013
+ // Go through the adapter to set the adapter on this connection
1014
+ // to ensure the object adapter is still active.
1015
+ dynamic_pointer_cast<ObjectAdapterI>(adapter)->setAdapterOnConnection(shared_from_this());
1016
+ }
1017
+ else
1018
+ {
1019
+ std::lock_guard lock(_mutex);
1020
+ if (_state <= StateNotValidated || _state >= StateClosing)
1021
+ {
1022
+ return;
1023
+ }
1024
+
1025
+ _adapter = nullptr;
1026
+ }
1027
+
1028
+ //
1029
+ // We never change the thread pool with which we were initially
1030
+ // registered, even if we add or remove an object adapter.
1031
+ //
1032
+ }
1033
+
1034
+ ObjectAdapterPtr
1035
+ Ice::ConnectionI::getAdapter() const noexcept
1036
+ {
1037
+ std::lock_guard lock(_mutex);
1038
+ return _adapter;
1039
+ }
1040
+
1041
+ EndpointPtr
1042
+ Ice::ConnectionI::getEndpoint() const noexcept
1043
+ {
1044
+ return _endpoint; // No mutex protection necessary, _endpoint is immutable.
1045
+ }
1046
+
1047
+ ObjectPrx
1048
+ Ice::ConnectionI::_createProxy(Identity ident) const
1049
+ {
1050
+ checkIdentity(ident, __FILE__, __LINE__);
1051
+ return ObjectPrx::_fromReference(
1052
+ _instance->referenceFactory()->create(std::move(ident), const_cast<ConnectionI*>(this)->shared_from_this()));
1053
+ }
1054
+
1055
+ void
1056
+ Ice::ConnectionI::setAdapterFromAdapter(const ObjectAdapterIPtr& adapter)
1057
+ {
1058
+ std::lock_guard lock(_mutex);
1059
+ if (_state <= StateNotValidated || _state >= StateClosing)
1060
+ {
1061
+ return;
1062
+ }
1063
+ assert(adapter); // Called by ObjectAdapterI::setAdapterOnConnection
1064
+ _adapter = adapter;
1065
+
1066
+ // Clear cached connection info (if any) as it's no longer accurate.
1067
+ _info = nullptr;
1068
+ }
1069
+
1070
+ #if defined(ICE_USE_IOCP)
1071
+ bool
1072
+ Ice::ConnectionI::startAsync(SocketOperation operation)
1073
+ {
1074
+ if (_state >= StateClosed)
1075
+ {
1076
+ return false;
1077
+ }
1078
+
1079
+ try
1080
+ {
1081
+ if (operation & SocketOperationWrite)
1082
+ {
1083
+ if (_observer)
1084
+ {
1085
+ _observer.startWrite(_writeStream);
1086
+ }
1087
+
1088
+ if (_transceiver->startWrite(_writeStream) && !_sendStreams.empty())
1089
+ {
1090
+ // The whole message is written, assume it's sent now for at-most-once semantics.
1091
+ _sendStreams.front().isSent = true;
1092
+ }
1093
+ }
1094
+ else if (operation & SocketOperationRead)
1095
+ {
1096
+ if (_observer && !_readHeader)
1097
+ {
1098
+ _observer.startRead(_readStream);
1099
+ }
1100
+
1101
+ _transceiver->startRead(_readStream);
1102
+ }
1103
+ }
1104
+ catch (const Ice::LocalException&)
1105
+ {
1106
+ setState(StateClosed, current_exception());
1107
+ return false;
1108
+ }
1109
+ return true;
1110
+ }
1111
+
1112
+ bool
1113
+ Ice::ConnectionI::finishAsync(SocketOperation operation)
1114
+ {
1115
+ try
1116
+ {
1117
+ if (operation & SocketOperationWrite)
1118
+ {
1119
+ Buffer::Container::iterator start = _writeStream.i;
1120
+ _transceiver->finishWrite(_writeStream);
1121
+ if (_instance->traceLevels()->network >= 3 && _writeStream.i != start)
1122
+ {
1123
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1124
+ out << "sent " << (_writeStream.i - start);
1125
+ if (!_endpoint->datagram())
1126
+ {
1127
+ out << " of " << (_writeStream.b.end() - start);
1128
+ }
1129
+ out << " bytes via " << _endpoint->protocol() << "\n" << toString();
1130
+ }
1131
+
1132
+ if (_observer)
1133
+ {
1134
+ _observer.finishWrite(_writeStream);
1135
+ }
1136
+ }
1137
+ else if (operation & SocketOperationRead)
1138
+ {
1139
+ Buffer::Container::iterator start = _readStream.i;
1140
+ _transceiver->finishRead(_readStream);
1141
+ if (_instance->traceLevels()->network >= 3 && _readStream.i != start)
1142
+ {
1143
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1144
+ out << "received ";
1145
+ if (_endpoint->datagram())
1146
+ {
1147
+ out << _readStream.b.size();
1148
+ }
1149
+ else
1150
+ {
1151
+ out << (_readStream.i - start) << " of " << (_readStream.b.end() - start);
1152
+ }
1153
+ out << " bytes via " << _endpoint->protocol() << "\n" << toString();
1154
+ }
1155
+
1156
+ if (_observer && !_readHeader)
1157
+ {
1158
+ _observer.finishRead(_readStream);
1159
+ }
1160
+ }
1161
+ }
1162
+ catch (const Ice::LocalException&)
1163
+ {
1164
+ setState(StateClosed, current_exception());
1165
+ }
1166
+ return _state < StateClosed;
1167
+ }
1168
+ #endif
1169
+
1170
+ void
1171
+ Ice::ConnectionI::message(ThreadPoolCurrent& current)
1172
+ {
1173
+ int upcallCount = 0;
1174
+
1175
+ function<void(ConnectionIPtr)> connectionStartCompleted;
1176
+ vector<OutgoingMessage> sentCBs;
1177
+ function<bool(InputStream&)> messageUpcall;
1178
+ InputStream messageStream{_instance.get(), currentProtocolEncoding};
1179
+
1180
+ ThreadPoolMessage<ConnectionI> msg(current, *this);
1181
+ {
1182
+ std::lock_guard lock(_mutex);
1183
+
1184
+ ThreadPoolMessage<ConnectionI>::IOScope io(msg);
1185
+ if (!io)
1186
+ {
1187
+ return;
1188
+ }
1189
+
1190
+ if (_state >= StateClosed)
1191
+ {
1192
+ return;
1193
+ }
1194
+
1195
+ try
1196
+ {
1197
+ SocketOperation writeOp = SocketOperationNone;
1198
+ SocketOperation readOp = SocketOperationNone;
1199
+
1200
+ // If writes are ready, write the data from the connection's write buffer (_writeStream)
1201
+ if (current.operation & SocketOperationWrite)
1202
+ {
1203
+ if (_observer)
1204
+ {
1205
+ _observer.startWrite(_writeStream);
1206
+ }
1207
+ writeOp = write(_writeStream);
1208
+ if (_observer && !(writeOp & SocketOperationWrite))
1209
+ {
1210
+ _observer.finishWrite(_writeStream);
1211
+ }
1212
+ }
1213
+
1214
+ // If reads are ready, read the data into the connection's read buffer (_readStream). The data is read
1215
+ // until:
1216
+ // - the full message is read (the transport read returns SocketOperationNone) and
1217
+ // the read buffer is fully filled
1218
+ // - the read operation on the transport can't continue without blocking
1219
+ if (current.operation & SocketOperationRead)
1220
+ {
1221
+ while (true)
1222
+ {
1223
+ if (_observer && !_readHeader)
1224
+ {
1225
+ _observer.startRead(_readStream);
1226
+ }
1227
+
1228
+ readOp = read(_readStream);
1229
+ if (readOp & SocketOperationRead)
1230
+ {
1231
+ // Can't continue without blocking, exit out of the loop.
1232
+ break;
1233
+ }
1234
+
1235
+ if (_observer && !_readHeader)
1236
+ {
1237
+ assert(_readStream.i == _readStream.b.end());
1238
+ _observer.finishRead(_readStream);
1239
+ }
1240
+
1241
+ // If read header is true, we're reading a new Ice protocol message and we need to read
1242
+ // the message header.
1243
+ if (_readHeader)
1244
+ {
1245
+ // The next read will read the remainder of the message.
1246
+ _readHeader = false;
1247
+
1248
+ if (_observer)
1249
+ {
1250
+ _observer->receivedBytes(static_cast<int>(headerSize));
1251
+ }
1252
+
1253
+ //
1254
+ // Connection is validated on first message. This is only used by
1255
+ // setState() to check whether or not we can print a connection
1256
+ // warning (a client might close the connection forcefully if the
1257
+ // connection isn't validated, we don't want to print a warning
1258
+ // in this case).
1259
+ //
1260
+ _validated = true;
1261
+
1262
+ // Full header should be read because the size of _readStream is always headerSize (14) when
1263
+ // reading a new message (see the code that sets _readHeader = true).
1264
+ ptrdiff_t pos = _readStream.i - _readStream.b.begin();
1265
+ if (pos < headerSize)
1266
+ {
1267
+ //
1268
+ // This situation is possible for small UDP packets.
1269
+ //
1270
+ throw MarshalException{
1271
+ __FILE__,
1272
+ __LINE__,
1273
+ "received Ice message with too few bytes in header"};
1274
+ }
1275
+
1276
+ // Decode the header.
1277
+ _readStream.i = _readStream.b.begin();
1278
+ const byte* m;
1279
+ _readStream.readBlob(m, static_cast<int32_t>(sizeof(magic)));
1280
+ if (m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3])
1281
+ {
1282
+ throw ProtocolException{__FILE__, __LINE__, createBadMagicMessage(m)};
1283
+ }
1284
+ ProtocolVersion pv;
1285
+ _readStream.read(pv);
1286
+ if (pv != currentProtocol)
1287
+ {
1288
+ throw ProtocolException{
1289
+ __FILE__,
1290
+ __LINE__,
1291
+ "invalid protocol version in message header: " + protocolVersionToString(pv)};
1292
+ }
1293
+ EncodingVersion ev;
1294
+ _readStream.read(ev);
1295
+ if (ev != currentProtocolEncoding)
1296
+ {
1297
+ throw ProtocolException{
1298
+ __FILE__,
1299
+ __LINE__,
1300
+ "invalid protocol encoding version in message header: " + encodingVersionToString(ev)};
1301
+ }
1302
+ uint8_t messageType;
1303
+ _readStream.read(messageType);
1304
+ uint8_t compressByte;
1305
+ _readStream.read(compressByte);
1306
+ int32_t size;
1307
+ _readStream.read(size);
1308
+ if (size < headerSize)
1309
+ {
1310
+ throw MarshalException{
1311
+ __FILE__,
1312
+ __LINE__,
1313
+ "received Ice message with unexpected size " + to_string(size)};
1314
+ }
1315
+
1316
+ // Resize the read buffer to the message size.
1317
+ if (size > _messageSizeMax)
1318
+ {
1319
+ Ex::throwMemoryLimitException(
1320
+ __FILE__,
1321
+ __LINE__,
1322
+ static_cast<size_t>(size),
1323
+ _messageSizeMax);
1324
+ }
1325
+ if (static_cast<size_t>(size) > _readStream.b.size())
1326
+ {
1327
+ _readStream.b.resize(static_cast<size_t>(size));
1328
+ }
1329
+ _readStream.i = _readStream.b.begin() + pos;
1330
+ }
1331
+
1332
+ if (_readStream.i != _readStream.b.end())
1333
+ {
1334
+ if (_endpoint->datagram())
1335
+ {
1336
+ throw DatagramLimitException(__FILE__, __LINE__); // The message was truncated.
1337
+ }
1338
+ continue;
1339
+ }
1340
+ break;
1341
+ }
1342
+ }
1343
+
1344
+ // readOp and writeOp are set to the operations that the transport read or write calls from above returned.
1345
+ // They indicate which operations will need to be monitored by the thread pool's selector when this method
1346
+ // returns.
1347
+ auto newOp = static_cast<SocketOperation>(readOp | writeOp);
1348
+
1349
+ // Operations that are ready. For example, if message was called with SocketOperationRead and the transport
1350
+ // read returned SocketOperationNone, reads are considered done: there's no additional data to read.
1351
+ auto readyOp = static_cast<SocketOperation>(current.operation & ~newOp);
1352
+
1353
+ if (_state <= StateNotValidated)
1354
+ {
1355
+ // If the connection is still not validated and there's still data to read or write, continue waiting
1356
+ // for data to read or write.
1357
+ if (newOp)
1358
+ {
1359
+ _threadPool->update(shared_from_this(), current.operation, newOp);
1360
+ return;
1361
+ }
1362
+
1363
+ // Initialize the connection if it's not initialized yet.
1364
+ if (_state == StateNotInitialized && !initialize(current.operation))
1365
+ {
1366
+ return;
1367
+ }
1368
+
1369
+ // Validate the connection if it's not validated yet.
1370
+ if (_state <= StateNotValidated && !validate(current.operation))
1371
+ {
1372
+ return;
1373
+ }
1374
+
1375
+ // The connection is validated and doesn't need additional data to be read or written. So unregister
1376
+ // it from the thread pool's selector.
1377
+ _threadPool->unregister(shared_from_this(), current.operation);
1378
+
1379
+ // The connection starts in the holding state. It will be activated by the connection factory.
1380
+ setState(StateHolding);
1381
+ if (_connectionStartCompleted)
1382
+ {
1383
+ connectionStartCompleted = std::move(_connectionStartCompleted);
1384
+ ++upcallCount;
1385
+ _connectionStartCompleted = nullptr;
1386
+ _connectionStartFailed = nullptr;
1387
+ }
1388
+ }
1389
+ else // The connection is active or waits for the CloseConnection message.
1390
+ {
1391
+ assert(_state <= StateClosingPending);
1392
+
1393
+ //
1394
+ // We parse messages first, if we receive a close
1395
+ // connection message we won't send more messages.
1396
+ //
1397
+ if (readyOp & SocketOperationRead)
1398
+ {
1399
+ // At this point, the protocol message is fully read and can therefore be decoded by parseMessage.
1400
+ // parseMessage returns the operation to wait for readiness next.
1401
+ newOp =
1402
+ static_cast<SocketOperation>(newOp | parseMessage(upcallCount, messageUpcall, messageStream));
1403
+ }
1404
+
1405
+ if (readyOp & SocketOperationWrite)
1406
+ {
1407
+ // At this point the message from _writeStream is fully written and the next message can be written.
1408
+
1409
+ newOp = static_cast<SocketOperation>(newOp | sendNextMessages(sentCBs));
1410
+ if (!sentCBs.empty())
1411
+ {
1412
+ ++upcallCount;
1413
+ }
1414
+ }
1415
+
1416
+ // If the connection is not closed yet, we update the thread pool selector to wait for readiness of
1417
+ // read, write or both operations.
1418
+ if (_state < StateClosed)
1419
+ {
1420
+ _threadPool->update(shared_from_this(), current.operation, newOp);
1421
+ }
1422
+ }
1423
+
1424
+ if (upcallCount == 0)
1425
+ {
1426
+ return; // Nothing to dispatch we're done!
1427
+ }
1428
+
1429
+ _upcallCount += upcallCount;
1430
+
1431
+ // There's something to dispatch so we mark IO as completed to elect a new leader thread and let IO be
1432
+ // performed on this new leader thread while this thread continues with dispatching the up-calls.
1433
+ io.completed();
1434
+ }
1435
+ catch (const DatagramLimitException&) // Expected.
1436
+ {
1437
+ if (_warnUdp)
1438
+ {
1439
+ Warning out(_instance->initializationData().logger);
1440
+ out << "maximum datagram size of " << _readStream.i - _readStream.b.begin() << " exceeded";
1441
+ }
1442
+ _readStream.resize(headerSize);
1443
+ _readStream.i = _readStream.b.begin();
1444
+ _readHeader = true;
1445
+ return;
1446
+ }
1447
+ catch (const SocketException&)
1448
+ {
1449
+ setState(StateClosed, current_exception());
1450
+ return;
1451
+ }
1452
+ catch (const LocalException& ex)
1453
+ {
1454
+ if (_endpoint->datagram())
1455
+ {
1456
+ if (_warn)
1457
+ {
1458
+ Warning out(_instance->initializationData().logger);
1459
+ out << "datagram connection exception:\n" << ex << '\n' << _desc;
1460
+ }
1461
+ _readStream.resize(headerSize);
1462
+ _readStream.i = _readStream.b.begin();
1463
+ _readHeader = true;
1464
+ }
1465
+ else
1466
+ {
1467
+ setState(StateClosed, current_exception());
1468
+ }
1469
+ return;
1470
+ }
1471
+ }
1472
+
1473
+ if (!_hasExecutor) // Optimization, call upcall() directly if there's no executor.
1474
+ {
1475
+ upcall(connectionStartCompleted, sentCBs, messageUpcall, messageStream);
1476
+ }
1477
+ else
1478
+ {
1479
+ auto stream = make_shared<InputStream>(_instance.get(), currentProtocolEncoding);
1480
+ stream->swap(messageStream);
1481
+
1482
+ auto self = shared_from_this();
1483
+ _threadPool->executeFromThisThread(
1484
+ [self,
1485
+ connectionStartCompleted = std::move(connectionStartCompleted),
1486
+ sentCBs = std::move(sentCBs),
1487
+ messageUpcall = std::move(messageUpcall),
1488
+ stream]() { self->upcall(connectionStartCompleted, sentCBs, messageUpcall, *stream); },
1489
+ self);
1490
+ }
1491
+ }
1492
+
1493
+ void
1494
+ ConnectionI::upcall(
1495
+ const function<void(ConnectionIPtr)>& connectionStartCompleted,
1496
+ const vector<OutgoingMessage>& sentCBs,
1497
+ const function<bool(InputStream&)>& messageUpcall,
1498
+ InputStream& messageStream)
1499
+ {
1500
+ int completedUpcallCount = 0;
1501
+
1502
+ //
1503
+ // Notify the factory that the connection establishment and
1504
+ // validation has completed.
1505
+ //
1506
+ if (connectionStartCompleted)
1507
+ {
1508
+ connectionStartCompleted(shared_from_this());
1509
+ ++completedUpcallCount;
1510
+ }
1511
+
1512
+ //
1513
+ // Notify AMI calls that the message was sent.
1514
+ //
1515
+ if (!sentCBs.empty())
1516
+ {
1517
+ for (const auto& sentCB : sentCBs)
1518
+ {
1519
+ #if defined(ICE_USE_IOCP)
1520
+ if (sentCB.invokeSent)
1521
+ {
1522
+ sentCB.outAsync->invokeSent();
1523
+ }
1524
+ if (sentCB.receivedReply)
1525
+ {
1526
+ auto o = dynamic_pointer_cast<OutgoingAsync>(sentCB.outAsync);
1527
+ if (o->response())
1528
+ {
1529
+ o->invokeResponse();
1530
+ }
1531
+ }
1532
+ #else
1533
+ sentCB.outAsync->invokeSent();
1534
+ #endif
1535
+ }
1536
+ ++completedUpcallCount;
1537
+ }
1538
+
1539
+ if (messageUpcall && messageUpcall(messageStream))
1540
+ {
1541
+ ++completedUpcallCount;
1542
+ }
1543
+
1544
+ //
1545
+ // Decrease the upcall count.
1546
+ //
1547
+ bool finished = false;
1548
+ if (completedUpcallCount > 0)
1549
+ {
1550
+ std::lock_guard lock(_mutex);
1551
+ _upcallCount -= completedUpcallCount;
1552
+ if (_upcallCount == 0)
1553
+ {
1554
+ // Only initiate shutdown if not already initiated. It might have already been initiated if the sent
1555
+ // callback or AMI callback was called when the connection was in the closing state.
1556
+ if (_state == StateClosing)
1557
+ {
1558
+ try
1559
+ {
1560
+ initiateShutdown();
1561
+ }
1562
+ catch (const LocalException&)
1563
+ {
1564
+ setState(StateClosed, current_exception());
1565
+ }
1566
+ }
1567
+ else if (_state == StateFinished)
1568
+ {
1569
+ finished = true;
1570
+ if (_observer)
1571
+ {
1572
+ _observer.detach();
1573
+ }
1574
+ }
1575
+ _conditionVariable.notify_all();
1576
+ }
1577
+ }
1578
+ if (finished && _removeFromFactory)
1579
+ {
1580
+ _removeFromFactory(shared_from_this());
1581
+ }
1582
+ }
1583
+
1584
+ void
1585
+ Ice::ConnectionI::finished(ThreadPoolCurrent& current, bool close)
1586
+ {
1587
+ // Lock the connection here to ensure setState() completes before the code below is executed. This method can be
1588
+ // called by the thread pool as soon as setState() calls _threadPool->finish(...). There's no need to lock the mutex
1589
+ // for the remainder of the code because the data members accessed by finish() are immutable once _state ==
1590
+ // StateClosed (and we don't want to hold the mutex when calling upcalls).
1591
+ {
1592
+ std::lock_guard lock(_mutex);
1593
+ assert(_state == StateClosed);
1594
+ }
1595
+
1596
+ // If there are no callbacks to call, we don't call ioCompleted() since we're not going to call code that will
1597
+ // potentially block (this avoids promoting a new leader and unecessary thread creation, especially if this is
1598
+ // called on shutdown).
1599
+ if (!_connectionStartCompleted && !_connectionStartFailed && _sendStreams.empty() && _asyncRequests.empty() &&
1600
+ !_closeCallback)
1601
+ {
1602
+ finish(close);
1603
+ return;
1604
+ }
1605
+
1606
+ current.ioCompleted();
1607
+
1608
+ if (!_hasExecutor) // Optimization, call finish() directly if there's no executor.
1609
+ {
1610
+ finish(close);
1611
+ }
1612
+ else
1613
+ {
1614
+ auto self = shared_from_this();
1615
+ _threadPool->executeFromThisThread([self, close]() { self->finish(close); }, self);
1616
+ }
1617
+ }
1618
+
1619
+ void
1620
+ Ice::ConnectionI::finish(bool close)
1621
+ {
1622
+ if (!_initialized)
1623
+ {
1624
+ if (_instance->traceLevels()->network >= 2)
1625
+ {
1626
+ string verb = _connector ? "establish" : "accept";
1627
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1628
+
1629
+ try
1630
+ {
1631
+ rethrow_exception(_exception);
1632
+ }
1633
+ catch (const std::exception& ex)
1634
+ {
1635
+ out << "failed to " << verb << " " << _endpoint->protocol() << " connection\n"
1636
+ << toString() << "\n"
1637
+ << ex;
1638
+ }
1639
+ }
1640
+ }
1641
+ else
1642
+ {
1643
+ if (_instance->traceLevels()->network >= 1)
1644
+ {
1645
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
1646
+ out << "closed " << _endpoint->protocol() << " connection\n" << toString();
1647
+
1648
+ try
1649
+ {
1650
+ rethrow_exception(_exception);
1651
+ }
1652
+ catch (const CommunicatorDestroyedException&)
1653
+ {
1654
+ }
1655
+ catch (const ObjectAdapterDeactivatedException&)
1656
+ {
1657
+ }
1658
+ catch (const ObjectAdapterDestroyedException&)
1659
+ {
1660
+ }
1661
+ catch (const std::exception& ex)
1662
+ {
1663
+ out << "\n" << ex;
1664
+ }
1665
+ }
1666
+ }
1667
+
1668
+ if (close)
1669
+ {
1670
+ try
1671
+ {
1672
+ _transceiver->close();
1673
+ }
1674
+ catch (const Ice::LocalException& ex)
1675
+ {
1676
+ Error out(_logger);
1677
+ out << "unexpected connection exception:\n" << ex << '\n' << _desc;
1678
+ }
1679
+ }
1680
+
1681
+ if (_connectionStartFailed)
1682
+ {
1683
+ assert(_exception);
1684
+ _connectionStartFailed(shared_from_this(), _exception);
1685
+ _connectionStartFailed = nullptr;
1686
+ _connectionStartCompleted = nullptr;
1687
+ }
1688
+
1689
+ if (!_sendStreams.empty())
1690
+ {
1691
+ if (!_writeStream.b.empty())
1692
+ {
1693
+ //
1694
+ // Return the stream to the outgoing call. This is important for
1695
+ // retriable AMI calls which are not marshaled again.
1696
+ //
1697
+ OutgoingMessage* message = &_sendStreams.front();
1698
+ _writeStream.swap(*message->stream);
1699
+
1700
+ #if defined(ICE_USE_IOCP)
1701
+ //
1702
+ // The current message might be sent but not yet removed from _sendStreams. If
1703
+ // the response has been received in the meantime, we remove the message from
1704
+ // _sendStreams to not call finished on a message which is already done.
1705
+ //
1706
+ if (message->isSent || message->receivedReply)
1707
+ {
1708
+ if (message->sent() && message->invokeSent)
1709
+ {
1710
+ message->outAsync->invokeSent();
1711
+ }
1712
+ if (message->receivedReply)
1713
+ {
1714
+ OutgoingAsyncPtr outAsync = dynamic_pointer_cast<OutgoingAsync>(message->outAsync);
1715
+ if (outAsync->response())
1716
+ {
1717
+ outAsync->invokeResponse();
1718
+ }
1719
+ }
1720
+ _sendStreams.pop_front();
1721
+ }
1722
+ #endif
1723
+ }
1724
+
1725
+ for (auto& sendStream : _sendStreams)
1726
+ {
1727
+ sendStream.completed(_exception);
1728
+ if (sendStream.requestId) // Make sure finished isn't called twice.
1729
+ {
1730
+ _asyncRequests.erase(sendStream.requestId);
1731
+ }
1732
+ }
1733
+
1734
+ _sendStreams.clear();
1735
+ }
1736
+
1737
+ for (const auto& asyncRequest : _asyncRequests)
1738
+ {
1739
+ if (asyncRequest.second->exception(_exception))
1740
+ {
1741
+ asyncRequest.second->invokeException();
1742
+ }
1743
+ }
1744
+
1745
+ _asyncRequests.clear();
1746
+
1747
+ //
1748
+ // Don't wait to be reaped to reclaim memory allocated by read/write streams.
1749
+ //
1750
+ _writeStream.clear();
1751
+ _writeStream.b.clear();
1752
+ _readStream.clear();
1753
+ _readStream.b.clear();
1754
+
1755
+ if (!_onClosedList.empty())
1756
+ {
1757
+ bool success;
1758
+ try
1759
+ {
1760
+ rethrow_exception(_exception);
1761
+ }
1762
+ catch (const ConnectionClosedException&)
1763
+ {
1764
+ success = true;
1765
+ }
1766
+ catch (const CloseConnectionException&)
1767
+ {
1768
+ success = true;
1769
+ }
1770
+ catch (const CommunicatorDestroyedException&)
1771
+ {
1772
+ success = true;
1773
+ }
1774
+ catch (const ObjectAdapterDeactivatedException&)
1775
+ {
1776
+ success = true;
1777
+ }
1778
+ catch (const ObjectAdapterDestroyedException&)
1779
+ {
1780
+ success = true;
1781
+ }
1782
+ catch (...)
1783
+ {
1784
+ success = false;
1785
+ }
1786
+
1787
+ for (const auto& pair : _onClosedList)
1788
+ {
1789
+ if (success)
1790
+ {
1791
+ if (pair.first)
1792
+ {
1793
+ pair.first();
1794
+ }
1795
+ }
1796
+ else
1797
+ {
1798
+ if (pair.second)
1799
+ {
1800
+ pair.second(_exception);
1801
+ }
1802
+ }
1803
+ }
1804
+ _onClosedList.clear(); // break potential cycles
1805
+ }
1806
+
1807
+ if (_closeCallback)
1808
+ {
1809
+ closeCallback(_closeCallback);
1810
+ _closeCallback = nullptr;
1811
+ }
1812
+
1813
+ // This must be done last as this will cause waitUntilFinished() to return (and communicator
1814
+ // objects such as the timer might be destroyed too).
1815
+ bool finished = false;
1816
+ {
1817
+ std::lock_guard lock(_mutex);
1818
+ setState(StateFinished);
1819
+
1820
+ if (_upcallCount == 0)
1821
+ {
1822
+ finished = true;
1823
+ if (_observer)
1824
+ {
1825
+ _observer.detach();
1826
+ }
1827
+ }
1828
+ }
1829
+ if (finished && _removeFromFactory)
1830
+ {
1831
+ _removeFromFactory(shared_from_this());
1832
+ }
1833
+ }
1834
+
1835
+ string
1836
+ Ice::ConnectionI::toString() const
1837
+ {
1838
+ return _desc; // No mutex lock, _desc is immutable.
1839
+ }
1840
+
1841
+ NativeInfoPtr
1842
+ Ice::ConnectionI::getNativeInfo()
1843
+ {
1844
+ return _transceiver->getNativeInfo();
1845
+ }
1846
+
1847
+ const string&
1848
+ Ice::ConnectionI::type() const noexcept
1849
+ {
1850
+ return _type; // No mutex lock, _type is immutable.
1851
+ }
1852
+
1853
+ ConnectionInfoPtr
1854
+ Ice::ConnectionI::getInfo() const
1855
+ {
1856
+ std::lock_guard lock(_mutex);
1857
+ if (_state >= StateClosed)
1858
+ {
1859
+ rethrow_exception(_exception);
1860
+ }
1861
+ return initConnectionInfo();
1862
+ }
1863
+
1864
+ void
1865
+ Ice::ConnectionI::setBufferSize(int32_t rcvSize, int32_t sndSize)
1866
+ {
1867
+ std::lock_guard lock(_mutex);
1868
+ if (_state >= StateClosed)
1869
+ {
1870
+ rethrow_exception(_exception);
1871
+ }
1872
+ _transceiver->setBufferSize(rcvSize, sndSize);
1873
+ _info = nullptr; // Invalidate the cached connection info
1874
+ }
1875
+
1876
+ void
1877
+ Ice::ConnectionI::exception(std::exception_ptr ex)
1878
+ {
1879
+ std::lock_guard lock(_mutex);
1880
+ setState(StateClosed, ex);
1881
+ }
1882
+
1883
+ Ice::ConnectionI::ConnectionI(
1884
+ CommunicatorPtr communicator,
1885
+ const InstancePtr& instance,
1886
+ const TransceiverPtr& transceiver,
1887
+ const ConnectorPtr& connector,
1888
+ const EndpointIPtr& endpoint,
1889
+ const shared_ptr<ObjectAdapterI>& adapter,
1890
+ std::function<void(const ConnectionIPtr&)> removeFromFactory,
1891
+ const ConnectionOptions& options) noexcept
1892
+ : _communicator(std::move(communicator)),
1893
+ _instance(instance),
1894
+ _transceiver(transceiver),
1895
+ _idleTimeoutTransceiver(dynamic_pointer_cast<IdleTimeoutTransceiverDecorator>(transceiver)),
1896
+ _desc(transceiver->toString()),
1897
+ _type(transceiver->protocol()),
1898
+ _connector(connector),
1899
+ _endpoint(endpoint),
1900
+ _adapter(adapter),
1901
+ _hasExecutor(_instance->initializationData().executor != nullptr), // Cached for better performance.
1902
+ _logger(_instance->initializationData().logger), // Cached for better performance.
1903
+ _traceLevels(_instance->traceLevels()), // Cached for better performance.
1904
+ _timer(_instance->timer()), // Cached for better performance.
1905
+ _connectTimeout(options.connectTimeout),
1906
+ _closeTimeout(options.closeTimeout), // not used for datagram connections
1907
+ // suppress inactivity timeout for datagram connections
1908
+ _inactivityTimeout(endpoint->datagram() ? chrono::seconds::zero() : options.inactivityTimeout),
1909
+ _removeFromFactory(std::move(removeFromFactory)),
1910
+ _warn(_instance->initializationData().properties->getIcePropertyAsInt("Ice.Warn.Connections") > 0),
1911
+ _warnUdp(_instance->initializationData().properties->getIcePropertyAsInt("Ice.Warn.Datagrams") > 0),
1912
+ _asyncRequestsHint(_asyncRequests.end()),
1913
+ _messageSizeMax(connector ? _instance->messageSizeMax() : adapter->messageSizeMax()),
1914
+ _batchRequestQueue(new BatchRequestQueue(instance, endpoint->datagram())),
1915
+ _readStream{instance.get(), currentProtocolEncoding},
1916
+ _maxDispatches(options.maxDispatches)
1917
+ {
1918
+ const Ice::PropertiesPtr& properties = _instance->initializationData().properties;
1919
+
1920
+ int& compressionLevel = const_cast<int&>(_compressionLevel);
1921
+ compressionLevel = properties->getIcePropertyAsInt("Ice.Compression.Level");
1922
+ if (compressionLevel < 1)
1923
+ {
1924
+ compressionLevel = 1;
1925
+ }
1926
+ else if (compressionLevel > 9)
1927
+ {
1928
+ compressionLevel = 9;
1929
+ }
1930
+ }
1931
+
1932
+ Ice::ConnectionIPtr
1933
+ Ice::ConnectionI::create(
1934
+ const CommunicatorPtr& communicator,
1935
+ const InstancePtr& instance,
1936
+ const TransceiverPtr& transceiver,
1937
+ const ConnectorPtr& connector,
1938
+ const EndpointIPtr& endpoint,
1939
+ const shared_ptr<ObjectAdapterI>& adapter,
1940
+ std::function<void(const ConnectionIPtr&)> removeFromFactory,
1941
+ const ConnectionOptions& options)
1942
+ {
1943
+ shared_ptr<IdleTimeoutTransceiverDecorator> decoratedTransceiver;
1944
+ if (options.idleTimeout > chrono::milliseconds::zero() && !endpoint->datagram())
1945
+ {
1946
+ decoratedTransceiver =
1947
+ make_shared<IdleTimeoutTransceiverDecorator>(transceiver, options.idleTimeout, instance->timer());
1948
+ }
1949
+
1950
+ Ice::ConnectionIPtr connection(new ConnectionI(
1951
+ communicator,
1952
+ instance,
1953
+ decoratedTransceiver ? decoratedTransceiver : transceiver,
1954
+ connector,
1955
+ endpoint,
1956
+ adapter,
1957
+ std::move(removeFromFactory),
1958
+ options));
1959
+
1960
+ if (connection->_inactivityTimeout > chrono::seconds::zero())
1961
+ {
1962
+ connection->_inactivityTimerTask = make_shared<InactivityTimerTask>(connection);
1963
+ }
1964
+
1965
+ if (decoratedTransceiver)
1966
+ {
1967
+ decoratedTransceiver->decoratorInit(connection, options.enableIdleCheck);
1968
+ }
1969
+
1970
+ if (connector) // client connection
1971
+ {
1972
+ const_cast<ThreadPoolPtr&>(connection->_threadPool) = connection->_instance->clientThreadPool();
1973
+ }
1974
+ else
1975
+ {
1976
+ // server connection
1977
+ assert(adapter);
1978
+ const_cast<ThreadPoolPtr&>(connection->_threadPool) = adapter->getThreadPool();
1979
+ }
1980
+ connection->_threadPool->initialize(connection);
1981
+ return connection;
1982
+ }
1983
+
1984
+ Ice::ConnectionI::~ConnectionI()
1985
+ {
1986
+ assert(!_connectionStartCompleted);
1987
+ assert(!_connectionStartFailed);
1988
+ assert(!_closeCallback);
1989
+ assert(_state == StateFinished);
1990
+ assert(_upcallCount == 0);
1991
+ assert(_sendStreams.empty());
1992
+ assert(_asyncRequests.empty());
1993
+ }
1994
+
1995
+ void
1996
+ Ice::ConnectionI::setState(State state, exception_ptr ex)
1997
+ {
1998
+ //
1999
+ // If setState() is called with an exception, then only closed and
2000
+ // closing states are permissible.
2001
+ //
2002
+ assert(state >= StateClosing);
2003
+
2004
+ if (_state == state) // Don't switch twice.
2005
+ {
2006
+ return;
2007
+ }
2008
+
2009
+ if (!_exception)
2010
+ {
2011
+ //
2012
+ // If we are in closed state, an exception must be set.
2013
+ //
2014
+ assert(_state != StateClosed);
2015
+ _exception = ex;
2016
+ //
2017
+ // We don't warn if we are not validated.
2018
+ //
2019
+ if (_warn && _validated)
2020
+ {
2021
+ //
2022
+ // Don't warn about certain expected exceptions.
2023
+ //
2024
+ try
2025
+ {
2026
+ rethrow_exception(ex);
2027
+ }
2028
+ catch (const CloseConnectionException&)
2029
+ {
2030
+ }
2031
+ catch (const ConnectionClosedException&)
2032
+ {
2033
+ }
2034
+ catch (const CommunicatorDestroyedException&)
2035
+ {
2036
+ }
2037
+ catch (const ObjectAdapterDeactivatedException&)
2038
+ {
2039
+ }
2040
+ catch (const ObjectAdapterDestroyedException&)
2041
+ {
2042
+ }
2043
+ catch (const ConnectionLostException& e)
2044
+ {
2045
+ if (_state < StateClosing)
2046
+ {
2047
+ Warning out(_logger);
2048
+ out << "connection exception:\n" << e << '\n' << _desc;
2049
+ }
2050
+ }
2051
+ catch (const std::exception& e)
2052
+ {
2053
+ Warning out(_logger);
2054
+ out << "connection exception:\n" << e << '\n' << _desc;
2055
+ }
2056
+ }
2057
+ }
2058
+
2059
+ //
2060
+ // We must set the new state before we notify requests of any
2061
+ // exceptions. Otherwise new requests may retry on a connection
2062
+ // that is not yet marked as closed or closing.
2063
+ //
2064
+ setState(state);
2065
+ }
2066
+
2067
+ void
2068
+ Ice::ConnectionI::setState(State state)
2069
+ {
2070
+ //
2071
+ // We don't want to send close connection messages if the endpoint
2072
+ // only supports oneway transmission from client to server.
2073
+ //
2074
+ if (_endpoint->datagram() && state == StateClosing)
2075
+ {
2076
+ state = StateClosed;
2077
+ }
2078
+
2079
+ //
2080
+ // Skip graceful shutdown if we are destroyed before validation.
2081
+ //
2082
+ if (_state <= StateNotValidated && state == StateClosing)
2083
+ {
2084
+ state = StateClosed;
2085
+ }
2086
+
2087
+ if (_state == state) // Don't switch twice.
2088
+ {
2089
+ return;
2090
+ }
2091
+
2092
+ if (state > StateActive)
2093
+ {
2094
+ cancelInactivityTimerTask();
2095
+ }
2096
+
2097
+ try
2098
+ {
2099
+ switch (state)
2100
+ {
2101
+ case StateNotInitialized:
2102
+ {
2103
+ assert(false);
2104
+ break;
2105
+ }
2106
+
2107
+ case StateNotValidated:
2108
+ {
2109
+ if (_state != StateNotInitialized)
2110
+ {
2111
+ assert(_state == StateClosed);
2112
+ return;
2113
+ }
2114
+ break;
2115
+ }
2116
+
2117
+ case StateActive:
2118
+ {
2119
+ // Can only switch from holding or not validated to active.
2120
+ if (_state != StateHolding && _state != StateNotValidated)
2121
+ {
2122
+ return;
2123
+ }
2124
+
2125
+ if (_maxDispatches <= 0 || _dispatchCount < _maxDispatches)
2126
+ {
2127
+ _threadPool->_register(shared_from_this(), SocketOperationRead);
2128
+ if (_idleTimeoutTransceiver)
2129
+ {
2130
+ _idleTimeoutTransceiver->enableIdleCheck();
2131
+ }
2132
+ }
2133
+ // else don't resume reading since we're at or over the _maxDispatches limit.
2134
+
2135
+ break;
2136
+ }
2137
+
2138
+ case StateHolding:
2139
+ {
2140
+ // Can only switch from active or not validated to holding.
2141
+ if (_state != StateActive && _state != StateNotValidated)
2142
+ {
2143
+ return;
2144
+ }
2145
+
2146
+ if (_state == StateActive && (_maxDispatches <= 0 || _dispatchCount < _maxDispatches))
2147
+ {
2148
+ _threadPool->unregister(shared_from_this(), SocketOperationRead);
2149
+ if (_idleTimeoutTransceiver)
2150
+ {
2151
+ _idleTimeoutTransceiver->disableIdleCheck();
2152
+ }
2153
+ }
2154
+ // else reads are already disabled because the _maxDispatches limit is reached or exceeded.
2155
+ break;
2156
+ }
2157
+
2158
+ case StateClosing:
2159
+ case StateClosingPending:
2160
+ {
2161
+ //
2162
+ // Can't change back from closing pending.
2163
+ //
2164
+ if (_state >= StateClosingPending)
2165
+ {
2166
+ return;
2167
+ }
2168
+ break;
2169
+ }
2170
+
2171
+ case StateClosed:
2172
+ {
2173
+ if (_state == StateFinished)
2174
+ {
2175
+ return;
2176
+ }
2177
+
2178
+ _batchRequestQueue->destroy(_exception);
2179
+
2180
+ //
2181
+ // Don't need to close now for connections so only close the transceiver
2182
+ // if the selector request it.
2183
+ //
2184
+ if (_threadPool->finish(shared_from_this(), false))
2185
+ {
2186
+ _transceiver->close();
2187
+ }
2188
+ break;
2189
+ }
2190
+
2191
+ case StateFinished:
2192
+ {
2193
+ assert(_state == StateClosed);
2194
+ _communicator = nullptr;
2195
+ break;
2196
+ }
2197
+ }
2198
+ }
2199
+ catch (const Ice::LocalException& ex)
2200
+ {
2201
+ Error out(_logger);
2202
+ out << "unexpected connection exception:\n" << ex << '\n' << _desc;
2203
+ }
2204
+
2205
+ if (_instance->initializationData().observer)
2206
+ {
2207
+ ConnectionState oldState = toConnectionState(_state);
2208
+ ConnectionState newState = toConnectionState(state);
2209
+ if (oldState != newState)
2210
+ {
2211
+ _observer.attach(
2212
+ _instance->initializationData()
2213
+ .observer->getConnectionObserver(initConnectionInfo(), _endpoint, newState, _observer.get()));
2214
+ }
2215
+ if (_observer && state == StateClosed && _exception)
2216
+ {
2217
+ try
2218
+ {
2219
+ rethrow_exception(_exception);
2220
+ }
2221
+ catch (const CloseConnectionException&)
2222
+ {
2223
+ }
2224
+ catch (const ConnectionClosedException&)
2225
+ {
2226
+ }
2227
+ catch (const CommunicatorDestroyedException&)
2228
+ {
2229
+ }
2230
+ catch (const ObjectAdapterDeactivatedException&)
2231
+ {
2232
+ }
2233
+ catch (const ObjectAdapterDestroyedException&)
2234
+ {
2235
+ }
2236
+ catch (const ConnectionLostException& ex)
2237
+ {
2238
+ if (_state < StateClosing)
2239
+ {
2240
+ _observer->failed(ex.ice_id());
2241
+ }
2242
+ }
2243
+ catch (const Ice::Exception& ex)
2244
+ {
2245
+ _observer->failed(ex.ice_id());
2246
+ }
2247
+ catch (const std::exception& ex)
2248
+ {
2249
+ _observer->failed(ex.what());
2250
+ }
2251
+ }
2252
+ }
2253
+ _state = state;
2254
+ _conditionVariable.notify_all();
2255
+
2256
+ if (_state == StateClosing && _upcallCount == 0)
2257
+ {
2258
+ try
2259
+ {
2260
+ initiateShutdown();
2261
+ }
2262
+ catch (const LocalException&)
2263
+ {
2264
+ setState(StateClosed, current_exception());
2265
+ }
2266
+ }
2267
+ }
2268
+
2269
+ void
2270
+ Ice::ConnectionI::initiateShutdown()
2271
+ {
2272
+ assert(_state == StateClosing && _upcallCount == 0);
2273
+
2274
+ if (_shutdownInitiated)
2275
+ {
2276
+ return;
2277
+ }
2278
+ _shutdownInitiated = true;
2279
+
2280
+ if (!_endpoint->datagram())
2281
+ {
2282
+ //
2283
+ // Before we shut down, we send a close connection message.
2284
+ //
2285
+ OutputStream os{currentProtocolEncoding};
2286
+ os.writeBlob(magic, sizeof(magic));
2287
+ os.write(currentProtocol);
2288
+ os.write(currentProtocolEncoding);
2289
+ os.write(closeConnectionMsg);
2290
+ os.write(static_cast<uint8_t>(0)); // compression status: always zero for close connection.
2291
+ os.write(headerSize); // Message size.
2292
+
2293
+ scheduleCloseTimerTask();
2294
+
2295
+ OutgoingMessage message(&os, false);
2296
+ if (sendMessage(message) & AsyncStatusSent)
2297
+ {
2298
+ setState(StateClosingPending);
2299
+
2300
+ //
2301
+ // Notify the transceiver of the graceful connection closure.
2302
+ //
2303
+ SocketOperation op = _transceiver->closing(true, _exception);
2304
+ if (op)
2305
+ {
2306
+ _threadPool->_register(shared_from_this(), op);
2307
+ }
2308
+ }
2309
+ }
2310
+ }
2311
+
2312
+ void
2313
+ Ice::ConnectionI::idleCheck(const chrono::seconds& idleTimeout) noexcept
2314
+ {
2315
+ std::lock_guard lock(_mutex);
2316
+ if (_state == StateActive && _idleTimeoutTransceiver->idleCheckEnabled())
2317
+ {
2318
+ setState(
2319
+ StateClosed,
2320
+ make_exception_ptr(ConnectionAbortedException{
2321
+ __FILE__,
2322
+ __LINE__,
2323
+ "connection aborted by the idle check because it did not receive any bytes for " +
2324
+ to_string(idleTimeout.count()) + "s",
2325
+ false})); // closedByApplication: false
2326
+ }
2327
+ // else, nothing to do
2328
+ }
2329
+
2330
+ void
2331
+ Ice::ConnectionI::inactivityCheck() noexcept
2332
+ {
2333
+ // Called by the InactivityTimerTask.
2334
+ std::lock_guard lock(_mutex);
2335
+
2336
+ // Make sure this timer task was not rescheduled for later while we were waiting for _mutex.
2337
+ if (_inactivityTimerTaskScheduled && !_timer->isScheduled(_inactivityTimerTask))
2338
+ {
2339
+ // Clear flag - the task is no longer scheduled.
2340
+ _inactivityTimerTaskScheduled = false;
2341
+
2342
+ if (_state == StateActive)
2343
+ {
2344
+ setState(
2345
+ StateClosing,
2346
+ make_exception_ptr(ConnectionClosedException{
2347
+ __FILE__,
2348
+ __LINE__,
2349
+ "connection closed because it remained inactive for longer than the inactivity timeout",
2350
+ false}));
2351
+ }
2352
+ }
2353
+ }
2354
+
2355
+ void
2356
+ Ice::ConnectionI::connectTimedOut() noexcept
2357
+ {
2358
+ std::lock_guard lock(_mutex);
2359
+ if (_state < StateActive)
2360
+ {
2361
+ setState(StateClosed, make_exception_ptr(ConnectTimeoutException(__FILE__, __LINE__)));
2362
+ }
2363
+ // else ignore since we're already connected.
2364
+ }
2365
+
2366
+ void
2367
+ Ice::ConnectionI::closeTimedOut() noexcept
2368
+ {
2369
+ std::lock_guard lock(_mutex);
2370
+ if (_state < StateClosed)
2371
+ {
2372
+ // We don't use setState(state, exception) because we want to overwrite the exception set by a
2373
+ // graceful closure.
2374
+ _exception = make_exception_ptr(CloseTimeoutException{__FILE__, __LINE__});
2375
+ setState(StateClosed);
2376
+ }
2377
+ // else ignore since we're already closed.
2378
+ }
2379
+
2380
+ void
2381
+ Ice::ConnectionI::sendHeartbeat() noexcept
2382
+ {
2383
+ assert(!_endpoint->datagram());
2384
+
2385
+ lock_guard lock(_mutex);
2386
+ if (_state == StateActive || _state == StateHolding || _state == StateClosing)
2387
+ {
2388
+ // We check if the connection has become inactive.
2389
+ if (_inactivityTimerTask && // null when the inactivity timeout is infinite
2390
+ !_inactivityTimerTaskScheduled && // we never reschedule this task
2391
+ _state == StateActive && // only schedule the task if the connection is active
2392
+ _dispatchCount == 0 && // no pending dispatch
2393
+ _asyncRequests.empty() && // no pending invocation
2394
+ _readHeader && // we're not waiting for the remainder of an incoming message
2395
+ _sendStreams.size() <= 1) // there is at most one pending outgoing message
2396
+ {
2397
+ // We may become inactive while the peer is back-pressuring us. In this case, we only schedule the
2398
+ // inactivity timer if there is no pending outgoing message or the pending outgoing message is a
2399
+ // heartbeat.
2400
+
2401
+ // The stream of the first _sendStreams message is in _writeStream.
2402
+ if (_sendStreams.empty() || static_cast<uint8_t>(_writeStream.b[8]) == validateConnectionMsg)
2403
+ {
2404
+ scheduleInactivityTimerTask();
2405
+ }
2406
+ }
2407
+
2408
+ // We send a heartbeat to the peer to generate a "write" on the connection. This write in turns creates
2409
+ // a read on the peer, and resets the peer's idle check timer. When _sendStream is not empty, there is
2410
+ // already an outstanding write, so we don't need to send a heartbeat. It's possible the first message
2411
+ // of _sendStreams was already sent but not yet removed from _sendStreams: it means the last write
2412
+ // occurred very recently, which is good enough with respect to the idle check.
2413
+ // As a result of this optimization, the only possible heartbeat in _sendStreams is the first
2414
+ // _sendStreams message.
2415
+ if (_sendStreams.empty())
2416
+ {
2417
+ OutputStream os{currentProtocolEncoding};
2418
+ os.writeBlob(magic, sizeof(magic));
2419
+ os.write(currentProtocol);
2420
+ os.write(currentProtocolEncoding);
2421
+ os.write(validateConnectionMsg);
2422
+ os.write(static_cast<uint8_t>(0)); // Compression status (always zero for validate connection).
2423
+ os.write(headerSize); // Message size.
2424
+ os.i = os.b.begin();
2425
+ try
2426
+ {
2427
+ OutgoingMessage message(&os, false);
2428
+ sendMessage(message);
2429
+ }
2430
+ catch (...)
2431
+ {
2432
+ setState(StateClosed, current_exception());
2433
+ }
2434
+ }
2435
+ }
2436
+ // else nothing to do
2437
+ }
2438
+
2439
+ void
2440
+ Ice::ConnectionI::sendResponse(OutgoingResponse response, uint8_t compress)
2441
+ {
2442
+ bool isTwoWay = !_endpoint->datagram() && response.current().requestId != 0;
2443
+
2444
+ bool finished = false;
2445
+ try
2446
+ {
2447
+ std::unique_lock lock(_mutex);
2448
+ assert(_state > StateNotValidated);
2449
+
2450
+ try
2451
+ {
2452
+ if (--_upcallCount == 0)
2453
+ {
2454
+ if (_state == StateFinished)
2455
+ {
2456
+ finished = true;
2457
+ if (_observer)
2458
+ {
2459
+ _observer.detach();
2460
+ }
2461
+ }
2462
+ _conditionVariable.notify_all();
2463
+ }
2464
+
2465
+ if (_state >= StateClosed)
2466
+ {
2467
+ exception_ptr exception = _exception;
2468
+ assert(exception);
2469
+
2470
+ if (finished && _removeFromFactory)
2471
+ {
2472
+ lock.unlock();
2473
+ _removeFromFactory(shared_from_this());
2474
+ }
2475
+
2476
+ rethrow_exception(exception);
2477
+ }
2478
+ assert(!finished);
2479
+
2480
+ if (isTwoWay)
2481
+ {
2482
+ OutgoingMessage message(&response.outputStream(), compress > 0);
2483
+ sendMessage(message);
2484
+ }
2485
+
2486
+ if (_state == StateActive && _maxDispatches > 0 && _dispatchCount == _maxDispatches)
2487
+ {
2488
+ // Resume reading if the connection is active and the dispatch count is about to be less than
2489
+ // _maxDispatches.
2490
+ _threadPool->update(shared_from_this(), SocketOperationNone, SocketOperationRead);
2491
+ if (_idleTimeoutTransceiver)
2492
+ {
2493
+ _idleTimeoutTransceiver->enableIdleCheck();
2494
+ }
2495
+ }
2496
+
2497
+ --_dispatchCount;
2498
+
2499
+ if (_state == StateClosing && _upcallCount == 0)
2500
+ {
2501
+ initiateShutdown();
2502
+ }
2503
+ }
2504
+ catch (const LocalException&)
2505
+ {
2506
+ setState(StateClosed, current_exception());
2507
+ }
2508
+ }
2509
+ catch (...)
2510
+ {
2511
+ dispatchException(current_exception(), 1);
2512
+ }
2513
+ }
2514
+
2515
+ bool
2516
+ Ice::ConnectionI::initialize(SocketOperation operation)
2517
+ {
2518
+ SocketOperation s = _transceiver->initialize(_readStream, _writeStream);
2519
+ if (s != SocketOperationNone)
2520
+ {
2521
+ _threadPool->update(shared_from_this(), operation, s);
2522
+ return false;
2523
+ }
2524
+
2525
+ //
2526
+ // Update the connection description once the transceiver is initialized.
2527
+ //
2528
+ const_cast<string&>(_desc) = _transceiver->toString();
2529
+ _initialized = true;
2530
+ setState(StateNotValidated);
2531
+ return true;
2532
+ }
2533
+
2534
+ bool
2535
+ Ice::ConnectionI::validate(SocketOperation operation)
2536
+ {
2537
+ if (!_endpoint->datagram()) // Datagram connections are always implicitly validated.
2538
+ {
2539
+ if (!_connector) // The server side has the active role for connection validation.
2540
+ {
2541
+ if (_writeStream.b.empty())
2542
+ {
2543
+ _writeStream.writeBlob(magic, sizeof(magic));
2544
+ _writeStream.write(currentProtocol);
2545
+ _writeStream.write(currentProtocolEncoding);
2546
+ _writeStream.write(validateConnectionMsg);
2547
+ _writeStream.write(
2548
+ static_cast<uint8_t>(0)); // Compression status (always zero for validate connection).
2549
+ _writeStream.write(headerSize); // Message size.
2550
+ _writeStream.i = _writeStream.b.begin();
2551
+ traceSend(_writeStream, _instance, this, _logger, _traceLevels);
2552
+ }
2553
+
2554
+ if (_observer)
2555
+ {
2556
+ _observer.startWrite(_writeStream);
2557
+ }
2558
+
2559
+ if (_writeStream.i != _writeStream.b.end())
2560
+ {
2561
+ SocketOperation op = write(_writeStream);
2562
+ if (op)
2563
+ {
2564
+ _threadPool->update(shared_from_this(), operation, op);
2565
+ return false;
2566
+ }
2567
+ }
2568
+
2569
+ if (_observer)
2570
+ {
2571
+ _observer.finishWrite(_writeStream);
2572
+ }
2573
+ }
2574
+ else // The client side has the passive role for connection validation.
2575
+ {
2576
+ if (_readStream.b.empty())
2577
+ {
2578
+ _readStream.b.resize(headerSize);
2579
+ _readStream.i = _readStream.b.begin();
2580
+ }
2581
+
2582
+ if (_observer)
2583
+ {
2584
+ _observer.startRead(_readStream);
2585
+ }
2586
+
2587
+ if (_readStream.i != _readStream.b.end())
2588
+ {
2589
+ SocketOperation op = read(_readStream);
2590
+ if (op)
2591
+ {
2592
+ _threadPool->update(shared_from_this(), operation, op);
2593
+ return false;
2594
+ }
2595
+ }
2596
+
2597
+ if (_observer)
2598
+ {
2599
+ _observer.finishRead(_readStream);
2600
+ }
2601
+
2602
+ _validated = true;
2603
+
2604
+ assert(_readStream.i == _readStream.b.end());
2605
+ _readStream.i = _readStream.b.begin();
2606
+ const std::byte* m;
2607
+ _readStream.readBlob(m, sizeof(magic));
2608
+ if (m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3])
2609
+ {
2610
+ throw ProtocolException{__FILE__, __LINE__, createBadMagicMessage(m)};
2611
+ }
2612
+ ProtocolVersion pv;
2613
+ _readStream.read(pv);
2614
+ if (pv != currentProtocol)
2615
+ {
2616
+ throw ProtocolException{
2617
+ __FILE__,
2618
+ __LINE__,
2619
+ "invalid protocol version in message header: " + protocolVersionToString(pv)};
2620
+ }
2621
+ EncodingVersion ev;
2622
+ _readStream.read(ev);
2623
+ if (ev != currentProtocolEncoding)
2624
+ {
2625
+ throw ProtocolException{
2626
+ __FILE__,
2627
+ __LINE__,
2628
+ "invalid protocol encoding version in message header: " + encodingVersionToString(ev)};
2629
+ }
2630
+ uint8_t messageType;
2631
+ _readStream.read(messageType);
2632
+ if (messageType != validateConnectionMsg)
2633
+ {
2634
+ throw ProtocolException{
2635
+ __FILE__,
2636
+ __LINE__,
2637
+ "received message of type " + to_string(messageType) +
2638
+ " over a connection that is not yet validated"};
2639
+ }
2640
+ uint8_t compress;
2641
+ _readStream.read(compress); // Ignore compression status for validate connection.
2642
+ int32_t size;
2643
+ _readStream.read(size);
2644
+ if (size != headerSize)
2645
+ {
2646
+ throw MarshalException{
2647
+ __FILE__,
2648
+ __LINE__,
2649
+ "received ValidateConnection message with unexpected size " + to_string(size)};
2650
+ }
2651
+ traceRecv(_readStream, this, _logger, _traceLevels);
2652
+
2653
+ // Client connection starts sending heartbeats once it has received the ValidateConnection message.
2654
+ if (_idleTimeoutTransceiver)
2655
+ {
2656
+ _idleTimeoutTransceiver->scheduleHeartbeat();
2657
+ }
2658
+ }
2659
+ }
2660
+
2661
+ _writeStream.resize(0);
2662
+ _writeStream.i = _writeStream.b.begin();
2663
+
2664
+ _readStream.resize(headerSize);
2665
+ _readStream.i = _readStream.b.begin();
2666
+ _readHeader = true;
2667
+
2668
+ if (_instance->traceLevels()->network >= 1)
2669
+ {
2670
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
2671
+ if (_endpoint->datagram())
2672
+ {
2673
+ out << "starting to " << (_connector ? "send" : "receive") << " " << _endpoint->protocol() << " messages\n";
2674
+ out << _transceiver->toDetailedString();
2675
+ }
2676
+ else
2677
+ {
2678
+ out << (_connector ? "established" : "accepted") << " " << _endpoint->protocol() << " connection\n";
2679
+ out << toString();
2680
+ }
2681
+ }
2682
+
2683
+ return true;
2684
+ }
2685
+
2686
+ SocketOperation
2687
+ Ice::ConnectionI::sendNextMessages(vector<OutgoingMessage>& callbacks)
2688
+ {
2689
+ if (_sendStreams.empty())
2690
+ {
2691
+ // This can occur if no message was being written and the socket write operation was registered with the
2692
+ // thread pool (a transceiver read method can request writing data).
2693
+ return SocketOperationNone;
2694
+ }
2695
+ else if (_state == StateClosingPending && _writeStream.i == _writeStream.b.begin())
2696
+ {
2697
+ // Message wasn't sent, empty the _writeStream, we're not going to send more data.
2698
+ OutgoingMessage* message = &_sendStreams.front();
2699
+ _writeStream.swap(*message->stream);
2700
+ return SocketOperationNone;
2701
+ }
2702
+
2703
+ // Assert that the message was fully written.
2704
+ assert(!_writeStream.b.empty() && _writeStream.i == _writeStream.b.end());
2705
+
2706
+ try
2707
+ {
2708
+ while (true)
2709
+ {
2710
+ //
2711
+ // The message that was being sent is sent. We can swap back the write stream buffer to the outgoing message
2712
+ // (required for retry) and queue its sent callback (if any).
2713
+ //
2714
+ OutgoingMessage* message = &_sendStreams.front();
2715
+ if (message->stream)
2716
+ {
2717
+ _writeStream.swap(*message->stream);
2718
+ if (message->sent())
2719
+ {
2720
+ callbacks.push_back(*message);
2721
+ }
2722
+ }
2723
+ _sendStreams.pop_front();
2724
+
2725
+ //
2726
+ // If there's nothing left to send, we're done.
2727
+ //
2728
+ if (_sendStreams.empty())
2729
+ {
2730
+ break;
2731
+ }
2732
+
2733
+ //
2734
+ // If we are in the closed state or if the close is pending, don't continue sending.
2735
+ //
2736
+ // This can occur if parseMessage (called before sendNextMessages by message()) closes the connection.
2737
+ //
2738
+ if (_state >= StateClosingPending)
2739
+ {
2740
+ return SocketOperationNone;
2741
+ }
2742
+
2743
+ //
2744
+ // Otherwise, prepare the next message.
2745
+ //
2746
+ message = &_sendStreams.front();
2747
+ assert(!message->stream->i);
2748
+ #ifdef ICE_HAS_BZIP2
2749
+ if (message->compress && message->stream->b.size() >= 100) // Only compress messages > 100 bytes.
2750
+ {
2751
+ //
2752
+ // Message compressed. Request compressed response, if any.
2753
+ //
2754
+ message->stream->b[9] = byte{2};
2755
+
2756
+ //
2757
+ // Do compression.
2758
+ //
2759
+ OutputStream stream{currentProtocolEncoding};
2760
+ doCompress(*message->stream, stream);
2761
+
2762
+ traceSend(*message->stream, _instance, this, _logger, _traceLevels);
2763
+
2764
+ message->adopt(&stream); // Adopt the compressed stream.
2765
+ message->stream->i = message->stream->b.begin();
2766
+ }
2767
+ else
2768
+ {
2769
+ #endif
2770
+ if (message->compress)
2771
+ {
2772
+ //
2773
+ // Message not compressed. Request compressed response, if any.
2774
+ //
2775
+ message->stream->b[9] = byte{1};
2776
+ }
2777
+
2778
+ //
2779
+ // No compression, just fill in the message size.
2780
+ //
2781
+ auto sz = static_cast<int32_t>(message->stream->b.size());
2782
+ const byte* p = reinterpret_cast<const byte*>(&sz);
2783
+ if constexpr (endian::native == endian::big)
2784
+ {
2785
+ reverse_copy(p, p + sizeof(int32_t), message->stream->b.begin() + 10);
2786
+ }
2787
+ else
2788
+ {
2789
+ copy(p, p + sizeof(int32_t), message->stream->b.begin() + 10);
2790
+ }
2791
+ message->stream->i = message->stream->b.begin();
2792
+ traceSend(*message->stream, _instance, this, _logger, _traceLevels);
2793
+
2794
+ #ifdef ICE_HAS_BZIP2
2795
+ }
2796
+ #endif
2797
+
2798
+ //
2799
+ // Send the message.
2800
+ //
2801
+ _writeStream.swap(*message->stream);
2802
+ if (_observer)
2803
+ {
2804
+ _observer.startWrite(_writeStream);
2805
+ }
2806
+ assert(_writeStream.i);
2807
+ if (_writeStream.i != _writeStream.b.end())
2808
+ {
2809
+ SocketOperation op = write(_writeStream);
2810
+ if (op)
2811
+ {
2812
+ return op;
2813
+ }
2814
+ }
2815
+ if (_observer)
2816
+ {
2817
+ _observer.finishWrite(_writeStream);
2818
+ }
2819
+
2820
+ // If the message was sent right away, loop to send the next queued message.
2821
+ }
2822
+
2823
+ // Once the CloseConnection message is sent, we transition to the StateClosingPending state.
2824
+ if (_state == StateClosing && _shutdownInitiated)
2825
+ {
2826
+ setState(StateClosingPending);
2827
+ SocketOperation op = _transceiver->closing(true, _exception);
2828
+ if (op)
2829
+ {
2830
+ return op;
2831
+ }
2832
+ }
2833
+ }
2834
+ catch (const Ice::LocalException&)
2835
+ {
2836
+ setState(StateClosed, current_exception());
2837
+ }
2838
+ return SocketOperationNone;
2839
+ }
2840
+
2841
+ AsyncStatus
2842
+ Ice::ConnectionI::sendMessage(OutgoingMessage& message)
2843
+ {
2844
+ assert(_state >= StateActive);
2845
+ assert(_state < StateClosed);
2846
+
2847
+ message.stream->i = nullptr; // Reset the message stream iterator before starting sending the message.
2848
+
2849
+ // Some messages are queued for sending. Just adds the message to the send queue and tell the caller that the
2850
+ // message was queued.
2851
+ if (!_sendStreams.empty())
2852
+ {
2853
+ _sendStreams.push_back(message);
2854
+ _sendStreams.back().adopt(nullptr);
2855
+ return AsyncStatusQueued;
2856
+ }
2857
+
2858
+ // Prepare and send the message.
2859
+ message.stream->i = message.stream->b.begin();
2860
+ SocketOperation op;
2861
+ #ifdef ICE_HAS_BZIP2
2862
+ if (message.compress && message.stream->b.size() >= 100) // Only compress messages larger than 100 bytes.
2863
+ {
2864
+ //
2865
+ // Message compressed. Request compressed response, if any.
2866
+ //
2867
+ message.stream->b[9] = byte{2};
2868
+
2869
+ //
2870
+ // Do compression.
2871
+ //
2872
+ OutputStream stream{currentProtocolEncoding};
2873
+ doCompress(*message.stream, stream);
2874
+ stream.i = stream.b.begin();
2875
+
2876
+ traceSend(*message.stream, _instance, this, _logger, _traceLevels);
2877
+
2878
+ if (_observer)
2879
+ {
2880
+ _observer.startWrite(stream);
2881
+ }
2882
+ op = write(stream);
2883
+ if (!op)
2884
+ {
2885
+ if (_observer)
2886
+ {
2887
+ _observer.finishWrite(stream);
2888
+ }
2889
+
2890
+ AsyncStatus status = AsyncStatusSent;
2891
+ if (message.sent())
2892
+ {
2893
+ status = static_cast<AsyncStatus>(status | AsyncStatusInvokeSentCallback);
2894
+ }
2895
+ return status;
2896
+ }
2897
+
2898
+ _sendStreams.push_back(message);
2899
+ _sendStreams.back().adopt(&stream);
2900
+ }
2901
+ else
2902
+ {
2903
+ #endif
2904
+ if (message.compress)
2905
+ {
2906
+ //
2907
+ // Message not compressed. Request compressed response, if any.
2908
+ //
2909
+ message.stream->b[9] = byte{1};
2910
+ }
2911
+
2912
+ //
2913
+ // No compression, just fill in the message size.
2914
+ //
2915
+ auto sz = static_cast<int32_t>(message.stream->b.size());
2916
+ const byte* p = reinterpret_cast<const byte*>(&sz);
2917
+ if constexpr (endian::native == endian::big)
2918
+ {
2919
+ reverse_copy(p, p + sizeof(int32_t), message.stream->b.begin() + 10);
2920
+ }
2921
+ else
2922
+ {
2923
+ copy(p, p + sizeof(int32_t), message.stream->b.begin() + 10);
2924
+ }
2925
+ message.stream->i = message.stream->b.begin();
2926
+
2927
+ traceSend(*message.stream, _instance, this, _logger, _traceLevels);
2928
+
2929
+ if (_observer)
2930
+ {
2931
+ _observer.startWrite(*message.stream);
2932
+ }
2933
+ op = write(*message.stream);
2934
+ if (!op)
2935
+ {
2936
+ if (_observer)
2937
+ {
2938
+ _observer.finishWrite(*message.stream);
2939
+ }
2940
+ AsyncStatus status = AsyncStatusSent;
2941
+ if (message.sent())
2942
+ {
2943
+ status = static_cast<AsyncStatus>(status | AsyncStatusInvokeSentCallback);
2944
+ }
2945
+ return status;
2946
+ }
2947
+
2948
+ _sendStreams.push_back(message);
2949
+ _sendStreams.back().adopt(nullptr); // Adopt the stream.
2950
+ #ifdef ICE_HAS_BZIP2
2951
+ }
2952
+ #endif
2953
+
2954
+ // The message couldn't be sent right away so we add it to the send stream queue (which is empty) and swap its
2955
+ // stream with `_writeStream`. The socket operation returned by the transceiver write is registered with the thread
2956
+ // pool. At this point the message() method will take care of sending the whole message (held by _writeStream) when
2957
+ // the transceiver is ready to write more of the message buffer.
2958
+
2959
+ _writeStream.swap(*_sendStreams.back().stream);
2960
+ _threadPool->_register(shared_from_this(), op);
2961
+ return AsyncStatusQueued;
2962
+ }
2963
+
2964
+ #ifdef ICE_HAS_BZIP2
2965
+ static string
2966
+ getBZ2Error(int bzError)
2967
+ {
2968
+ if (bzError == BZ_RUN_OK)
2969
+ {
2970
+ return ": BZ_RUN_OK";
2971
+ }
2972
+ else if (bzError == BZ_FLUSH_OK)
2973
+ {
2974
+ return ": BZ_FLUSH_OK";
2975
+ }
2976
+ else if (bzError == BZ_FINISH_OK)
2977
+ {
2978
+ return ": BZ_FINISH_OK";
2979
+ }
2980
+ else if (bzError == BZ_STREAM_END)
2981
+ {
2982
+ return ": BZ_STREAM_END";
2983
+ }
2984
+ else if (bzError == BZ_CONFIG_ERROR)
2985
+ {
2986
+ return ": BZ_CONFIG_ERROR";
2987
+ }
2988
+ else if (bzError == BZ_SEQUENCE_ERROR)
2989
+ {
2990
+ return ": BZ_SEQUENCE_ERROR";
2991
+ }
2992
+ else if (bzError == BZ_PARAM_ERROR)
2993
+ {
2994
+ return ": BZ_PARAM_ERROR";
2995
+ }
2996
+ else if (bzError == BZ_MEM_ERROR)
2997
+ {
2998
+ return ": BZ_MEM_ERROR";
2999
+ }
3000
+ else if (bzError == BZ_DATA_ERROR)
3001
+ {
3002
+ return ": BZ_DATA_ERROR";
3003
+ }
3004
+ else if (bzError == BZ_DATA_ERROR_MAGIC)
3005
+ {
3006
+ return ": BZ_DATA_ERROR_MAGIC";
3007
+ }
3008
+ else if (bzError == BZ_IO_ERROR)
3009
+ {
3010
+ return ": BZ_IO_ERROR";
3011
+ }
3012
+ else if (bzError == BZ_UNEXPECTED_EOF)
3013
+ {
3014
+ return ": BZ_UNEXPECTED_EOF";
3015
+ }
3016
+ else if (bzError == BZ_OUTBUFF_FULL)
3017
+ {
3018
+ return ": BZ_OUTBUFF_FULL";
3019
+ }
3020
+ else
3021
+ {
3022
+ return "";
3023
+ }
3024
+ }
3025
+
3026
+ void
3027
+ Ice::ConnectionI::doCompress(OutputStream& uncompressed, OutputStream& compressed)
3028
+ {
3029
+ const byte* p;
3030
+
3031
+ //
3032
+ // Compress the message body, but not the header.
3033
+ //
3034
+ auto uncompressedLen = static_cast<unsigned int>(uncompressed.b.size() - headerSize);
3035
+ auto compressedLen = static_cast<unsigned int>(uncompressedLen * 1.01 + 600);
3036
+ compressed.b.resize(headerSize + sizeof(int32_t) + compressedLen);
3037
+ int bzError = BZ2_bzBuffToBuffCompress(
3038
+ reinterpret_cast<char*>(&compressed.b[0]) + headerSize + sizeof(int32_t),
3039
+ &compressedLen,
3040
+ reinterpret_cast<char*>(&uncompressed.b[0]) + headerSize,
3041
+ uncompressedLen,
3042
+ _compressionLevel,
3043
+ 0,
3044
+ 0);
3045
+ if (bzError != BZ_OK)
3046
+ {
3047
+ throw ProtocolException{
3048
+ __FILE__,
3049
+ __LINE__,
3050
+ "cannot compress message - BZ2_bzBuffToBuffCompress failed" + getBZ2Error(bzError)};
3051
+ }
3052
+ compressed.b.resize(headerSize + sizeof(int32_t) + compressedLen);
3053
+
3054
+ //
3055
+ // Write the size of the compressed stream into the header of the
3056
+ // uncompressed stream. Since the header will be copied, this size
3057
+ // will also be in the header of the compressed stream.
3058
+ //
3059
+ auto compressedSize = static_cast<int32_t>(compressed.b.size());
3060
+ p = reinterpret_cast<const byte*>(&compressedSize);
3061
+ if constexpr (endian::native == endian::big)
3062
+ {
3063
+ reverse_copy(p, p + sizeof(int32_t), uncompressed.b.begin() + 10);
3064
+ }
3065
+ else
3066
+ {
3067
+ copy(p, p + sizeof(int32_t), uncompressed.b.begin() + 10);
3068
+ }
3069
+
3070
+ //
3071
+ // Add the size of the uncompressed stream before the message body
3072
+ // of the compressed stream.
3073
+ //
3074
+ auto uncompressedSize = static_cast<int32_t>(uncompressed.b.size());
3075
+ p = reinterpret_cast<const byte*>(&uncompressedSize);
3076
+ if constexpr (endian::native == endian::big)
3077
+ {
3078
+ reverse_copy(p, p + sizeof(int32_t), compressed.b.begin() + headerSize);
3079
+ }
3080
+ else
3081
+ {
3082
+ copy(p, p + sizeof(int32_t), compressed.b.begin() + headerSize);
3083
+ }
3084
+
3085
+ //
3086
+ // Copy the header from the uncompressed stream to the compressed one.
3087
+ //
3088
+ copy(uncompressed.b.begin(), uncompressed.b.begin() + headerSize, compressed.b.begin());
3089
+ }
3090
+
3091
+ void
3092
+ Ice::ConnectionI::doUncompress(InputStream& compressed, InputStream& uncompressed)
3093
+ {
3094
+ int32_t uncompressedSize;
3095
+ compressed.i = compressed.b.begin() + headerSize;
3096
+ compressed.read(uncompressedSize);
3097
+ if (uncompressedSize <= headerSize)
3098
+ {
3099
+ throw MarshalException{
3100
+ __FILE__,
3101
+ __LINE__,
3102
+ "unexpected message size after uncompress: " + to_string(uncompressedSize)};
3103
+ }
3104
+
3105
+ if (uncompressedSize > _messageSizeMax)
3106
+ {
3107
+ Ex::throwMemoryLimitException(__FILE__, __LINE__, static_cast<size_t>(uncompressedSize), _messageSizeMax);
3108
+ }
3109
+ uncompressed.resize(static_cast<size_t>(uncompressedSize));
3110
+
3111
+ auto uncompressedLen = static_cast<unsigned int>(uncompressedSize - headerSize);
3112
+ auto compressedLen = static_cast<unsigned int>(compressed.b.size() - headerSize - sizeof(int32_t));
3113
+ int bzError = BZ2_bzBuffToBuffDecompress(
3114
+ reinterpret_cast<char*>(&uncompressed.b[0]) + headerSize,
3115
+ &uncompressedLen,
3116
+ reinterpret_cast<char*>(&compressed.b[0]) + headerSize + sizeof(int32_t),
3117
+ compressedLen,
3118
+ 0,
3119
+ 0);
3120
+ if (bzError != BZ_OK)
3121
+ {
3122
+ throw ProtocolException{
3123
+ __FILE__,
3124
+ __LINE__,
3125
+ "cannot decompress message - BZ2_bzBuffToBuffDecompress failed" + getBZ2Error(bzError)};
3126
+ }
3127
+
3128
+ copy(compressed.b.begin(), compressed.b.begin() + headerSize, uncompressed.b.begin());
3129
+ }
3130
+ #endif
3131
+
3132
+ SocketOperation
3133
+ Ice::ConnectionI::parseMessage(int32_t& upcallCount, function<bool(InputStream&)>& upcall, InputStream& stream)
3134
+ {
3135
+ assert(_state > StateNotValidated && _state < StateClosed);
3136
+
3137
+ _readStream.swap(stream);
3138
+ _readStream.resize(headerSize);
3139
+ _readStream.i = _readStream.b.begin();
3140
+ _readHeader = true;
3141
+
3142
+ assert(stream.i == stream.b.end());
3143
+
3144
+ try
3145
+ {
3146
+ //
3147
+ // We don't need to check magic and version here. This has
3148
+ // already been done by the ThreadPool, which provides us
3149
+ // with the stream.
3150
+ //
3151
+ assert(stream.i == stream.b.end());
3152
+ stream.i = stream.b.begin() + 8;
3153
+ uint8_t messageType;
3154
+ stream.read(messageType);
3155
+ uint8_t compress;
3156
+ stream.read(compress);
3157
+
3158
+ if (compress == 2)
3159
+ {
3160
+ #ifdef ICE_HAS_BZIP2
3161
+ InputStream ustream{_instance.get(), currentProtocolEncoding};
3162
+ doUncompress(stream, ustream);
3163
+ stream.b.swap(ustream.b);
3164
+ #else
3165
+ throw FeatureNotSupportedException(__FILE__, __LINE__, "Cannot uncompress compressed message");
3166
+ #endif
3167
+ }
3168
+ stream.i = stream.b.begin() + headerSize;
3169
+
3170
+ switch (messageType)
3171
+ {
3172
+ case closeConnectionMsg:
3173
+ {
3174
+ traceRecv(stream, this, _logger, _traceLevels);
3175
+ if (_endpoint->datagram())
3176
+ {
3177
+ if (_warn)
3178
+ {
3179
+ Warning out(_logger);
3180
+ out << "ignoring close connection message for datagram connection:\n" << _desc;
3181
+ }
3182
+ }
3183
+ else
3184
+ {
3185
+ setState(StateClosingPending, make_exception_ptr(CloseConnectionException(__FILE__, __LINE__)));
3186
+
3187
+ //
3188
+ // Notify the transceiver of the graceful connection closure.
3189
+ //
3190
+ SocketOperation op = _transceiver->closing(false, _exception);
3191
+ if (op)
3192
+ {
3193
+ scheduleCloseTimerTask();
3194
+ return op;
3195
+ }
3196
+ setState(StateClosed);
3197
+ }
3198
+ break;
3199
+ }
3200
+
3201
+ case requestMsg:
3202
+ {
3203
+ if (_state >= StateClosing)
3204
+ {
3205
+ trace(
3206
+ "received request during closing\n(ignored by server, client will retry)",
3207
+ stream,
3208
+ this,
3209
+ _logger,
3210
+ _traceLevels);
3211
+ }
3212
+ else
3213
+ {
3214
+ traceRecv(stream, this, _logger, _traceLevels);
3215
+
3216
+ auto adapter = _adapter;
3217
+ const int32_t requestCount = 1;
3218
+ int32_t requestId;
3219
+
3220
+ stream.read(requestId);
3221
+
3222
+ upcall = [self = shared_from_this(), requestId, adapter, compress](InputStream& messageStream)
3223
+ {
3224
+ self->dispatchAll(messageStream, requestCount, requestId, compress, adapter);
3225
+ return false; // the upcall will be completed once the dispatch is done.
3226
+ };
3227
+ ++upcallCount;
3228
+
3229
+ cancelInactivityTimerTask();
3230
+ ++_dispatchCount;
3231
+ }
3232
+ break;
3233
+ }
3234
+
3235
+ case requestBatchMsg:
3236
+ {
3237
+ if (_state >= StateClosing)
3238
+ {
3239
+ trace(
3240
+ "received batch request during closing\n(ignored by server, client will retry)",
3241
+ stream,
3242
+ this,
3243
+ _logger,
3244
+ _traceLevels);
3245
+ }
3246
+ else
3247
+ {
3248
+ traceRecv(stream, this, _logger, _traceLevels);
3249
+
3250
+ auto adapter = _adapter;
3251
+ const int32_t requestId = 0;
3252
+ int32_t requestCount;
3253
+
3254
+ stream.read(requestCount);
3255
+ if (requestCount < 0)
3256
+ {
3257
+ requestCount = 0;
3258
+ throw MarshalException{
3259
+ __FILE__,
3260
+ __LINE__,
3261
+ "received batch request with " + to_string(requestCount) + " batches"};
3262
+ }
3263
+
3264
+ upcall = [self = shared_from_this(), requestCount, adapter, compress](InputStream& messageStream)
3265
+ {
3266
+ self->dispatchAll(messageStream, requestCount, requestId, compress, adapter);
3267
+ return false; // the upcall will be completed once the servant dispatch is done.
3268
+ };
3269
+ upcallCount += requestCount;
3270
+
3271
+ cancelInactivityTimerTask();
3272
+ _dispatchCount += requestCount;
3273
+ }
3274
+ break;
3275
+ }
3276
+
3277
+ case replyMsg:
3278
+ {
3279
+ traceRecv(stream, this, _logger, _traceLevels);
3280
+
3281
+ int32_t requestId;
3282
+ stream.read(requestId);
3283
+
3284
+ auto q = _asyncRequests.end();
3285
+
3286
+ if (_asyncRequestsHint != _asyncRequests.end())
3287
+ {
3288
+ if (_asyncRequestsHint->first == requestId)
3289
+ {
3290
+ q = _asyncRequestsHint;
3291
+ }
3292
+ }
3293
+
3294
+ if (q == _asyncRequests.end())
3295
+ {
3296
+ q = _asyncRequests.find(requestId);
3297
+ }
3298
+
3299
+ if (q != _asyncRequests.end())
3300
+ {
3301
+ auto outAsync = q->second;
3302
+
3303
+ if (q == _asyncRequestsHint)
3304
+ {
3305
+ _asyncRequests.erase(q++);
3306
+ _asyncRequestsHint = q;
3307
+ }
3308
+ else
3309
+ {
3310
+ _asyncRequests.erase(q);
3311
+ }
3312
+
3313
+ // The message stream is adopted by the outgoing.
3314
+ *outAsync->getIs() = std::move(stream);
3315
+
3316
+ #if defined(ICE_USE_IOCP)
3317
+ //
3318
+ // If we just received the reply of a request which isn't acknowledge as
3319
+ // sent yet, we queue the reply instead of processing it right away. It
3320
+ // will be processed once the write callback is invoked for the message.
3321
+ //
3322
+ OutgoingMessage* message = _sendStreams.empty() ? 0 : &_sendStreams.front();
3323
+ if (message && message->outAsync.get() == outAsync.get())
3324
+ {
3325
+ message->receivedReply = true;
3326
+ outAsync = 0;
3327
+ }
3328
+ #endif
3329
+ if (outAsync && outAsync->response())
3330
+ {
3331
+ // The message stream is not used here because it has been adopted above.
3332
+ upcall = [outAsync](InputStream&)
3333
+ {
3334
+ outAsync->invokeResponse();
3335
+ return true; // upcall is done
3336
+ };
3337
+ ++upcallCount;
3338
+ }
3339
+ if (_closeRequested && _state < StateClosing && _asyncRequests.empty())
3340
+ {
3341
+ doApplicationClose();
3342
+ }
3343
+ }
3344
+
3345
+ break;
3346
+ }
3347
+
3348
+ case validateConnectionMsg:
3349
+ {
3350
+ traceRecv(stream, this, _logger, _traceLevels);
3351
+ // a heartbeat has no effect on the dispatch count or the inactivity timer task.
3352
+ break;
3353
+ }
3354
+
3355
+ default:
3356
+ {
3357
+ trace("received unknown message\n(invalid, closing connection)", stream, this, _logger, _traceLevels);
3358
+ throw ProtocolException{
3359
+ __FILE__,
3360
+ __LINE__,
3361
+ "received Ice protocol message with unknown type: " + to_string(messageType)};
3362
+ }
3363
+ }
3364
+ }
3365
+ catch (const LocalException& ex)
3366
+ {
3367
+ if (_endpoint->datagram())
3368
+ {
3369
+ if (_warn)
3370
+ {
3371
+ Warning out(_logger);
3372
+ out << "datagram connection exception:\n" << ex << '\n' << _desc;
3373
+ }
3374
+ }
3375
+ else
3376
+ {
3377
+ setState(StateClosed, current_exception());
3378
+ }
3379
+ }
3380
+
3381
+ if (_state == StateHolding)
3382
+ {
3383
+ // Don't continue reading if the connection is in the holding state.
3384
+ return SocketOperationNone;
3385
+ }
3386
+ else if (_maxDispatches > 0 && _dispatchCount >= _maxDispatches)
3387
+ {
3388
+ // Don't continue reading if the _maxDispatches limit is reached or exceeded.
3389
+ if (_idleTimeoutTransceiver)
3390
+ {
3391
+ _idleTimeoutTransceiver->disableIdleCheck();
3392
+ }
3393
+ return SocketOperationNone;
3394
+ }
3395
+ else
3396
+ {
3397
+ // Continue reading.
3398
+ return SocketOperationRead;
3399
+ }
3400
+ }
3401
+
3402
+ void
3403
+ Ice::ConnectionI::dispatchAll(
3404
+ InputStream& stream,
3405
+ int32_t requestCount,
3406
+ int32_t requestId,
3407
+ uint8_t compress,
3408
+ const ObjectAdapterIPtr& adapter)
3409
+ {
3410
+ // Note: In contrast to other private or protected methods, this operation must be called *without* the mutex
3411
+ // locked.
3412
+
3413
+ try
3414
+ {
3415
+ while (requestCount > 0)
3416
+ {
3417
+ //
3418
+ // Start of the dispatch pipeline.
3419
+ //
3420
+
3421
+ IncomingRequest request{requestId, shared_from_this(), adapter, stream, requestCount};
3422
+
3423
+ if (adapter)
3424
+ {
3425
+ try
3426
+ {
3427
+ adapter->dispatchPipeline()->dispatch(
3428
+ request,
3429
+ [self = shared_from_this(), compress](OutgoingResponse response)
3430
+ { self->sendResponse(std::move(response), compress); });
3431
+ }
3432
+ catch (...)
3433
+ {
3434
+ sendResponse(makeOutgoingResponse(current_exception(), request.current()), 0);
3435
+ }
3436
+ }
3437
+ else
3438
+ {
3439
+ // Received request on a connection without an object adapter.
3440
+ sendResponse(
3441
+ makeOutgoingResponse(
3442
+ make_exception_ptr(ObjectNotExistException{__FILE__, __LINE__}),
3443
+ request.current()),
3444
+ 0);
3445
+ }
3446
+
3447
+ --requestCount;
3448
+ }
3449
+
3450
+ stream.clear();
3451
+ }
3452
+ catch (...)
3453
+ {
3454
+ dispatchException(current_exception(), requestCount); // Fatal invocation exception
3455
+ }
3456
+ }
3457
+
3458
+ Ice::ConnectionInfoPtr
3459
+ Ice::ConnectionI::initConnectionInfo() const
3460
+ {
3461
+ // Called with _mutex locked.
3462
+
3463
+ if (_state > StateNotInitialized && _info) // Update the connection information until it's initialized
3464
+ {
3465
+ return _info;
3466
+ }
3467
+
3468
+ bool incoming = !_connector;
3469
+ _info = _transceiver->getInfo(incoming, _adapter ? _adapter->getName() : string{}, _endpoint->connectionId());
3470
+ return _info;
3471
+ }
3472
+
3473
+ ConnectionState
3474
+ ConnectionI::toConnectionState(State state) const
3475
+ {
3476
+ return connectionStateMap[static_cast<int>(state)];
3477
+ }
3478
+
3479
+ SocketOperation
3480
+ ConnectionI::read(Buffer& buf)
3481
+ {
3482
+ Buffer::Container::iterator start = buf.i;
3483
+ SocketOperation op = _transceiver->read(buf);
3484
+ if (_instance->traceLevels()->network >= 3 && buf.i != start)
3485
+ {
3486
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
3487
+ out << "received ";
3488
+ if (_endpoint->datagram())
3489
+ {
3490
+ out << buf.b.size();
3491
+ }
3492
+ else
3493
+ {
3494
+ out << (buf.i - start) << " of " << (buf.b.end() - start);
3495
+ }
3496
+ out << " bytes via " << _endpoint->protocol() << "\n" << toString();
3497
+ }
3498
+ return op;
3499
+ }
3500
+
3501
+ SocketOperation
3502
+ ConnectionI::write(Buffer& buf)
3503
+ {
3504
+ Buffer::Container::iterator start = buf.i;
3505
+ SocketOperation op = _transceiver->write(buf);
3506
+ if (_instance->traceLevels()->network >= 3 && buf.i != start)
3507
+ {
3508
+ Trace out(_instance->initializationData().logger, _instance->traceLevels()->networkCat);
3509
+ out << "sent " << (buf.i - start);
3510
+ if (!_endpoint->datagram())
3511
+ {
3512
+ out << " of " << (buf.b.end() - start);
3513
+ }
3514
+ out << " bytes via " << _endpoint->protocol() << "\n" << toString();
3515
+ }
3516
+ return op;
3517
+ }
3518
+
3519
+ void
3520
+ ConnectionI::scheduleInactivityTimerTask()
3521
+ {
3522
+ // Called with the ConnectionI mutex locked.
3523
+ assert(!_inactivityTimerTaskScheduled);
3524
+ assert(_inactivityTimerTask);
3525
+
3526
+ _inactivityTimerTaskScheduled = true;
3527
+ _timer->schedule(_inactivityTimerTask, _inactivityTimeout);
3528
+ }
3529
+
3530
+ void
3531
+ ConnectionI::cancelInactivityTimerTask() noexcept
3532
+ {
3533
+ // Called with the ConnectionI mutex locked.
3534
+ if (_inactivityTimerTaskScheduled && _inactivityTimerTask)
3535
+ {
3536
+ _inactivityTimerTaskScheduled = false;
3537
+ _timer->cancel(_inactivityTimerTask);
3538
+ }
3539
+ }
3540
+
3541
+ void
3542
+ ConnectionI::scheduleCloseTimerTask()
3543
+ {
3544
+ // Called with the ConnectionI mutex locked.
3545
+
3546
+ if (_closeTimeout > chrono::seconds::zero())
3547
+ {
3548
+ // We schedule a new task every time this function is called.
3549
+ _timer->schedule(make_shared<CloseTimerTask>(shared_from_this()), _closeTimeout);
3550
+ }
3551
+ }
3552
+
3553
+ void
3554
+ ConnectionI::doApplicationClose() noexcept
3555
+ {
3556
+ // Called with the ConnectionI mutex locked.
3557
+ assert(_state < StateClosing);
3558
+
3559
+ setState(
3560
+ StateClosing,
3561
+ make_exception_ptr(
3562
+ ConnectionClosedException{__FILE__, __LINE__, "connection closed gracefully by the application", true}));
3563
+ }