Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches

◆ ice_getCachedConnection()

Ice::ConnectionPtr Ice::ObjectPrx::ice_getCachedConnection ( ) const
nodiscardnoexcept

Gets the Connection cached by this proxy.

Once this proxy has been associated with a connection (typically during its first invocation), it caches this connection and continues using it for subsequent invocations, until an invocation on this proxy fails. This function never attempts to establish a connection. For a fixed proxy, this function returns the connection this proxy is bound to, even when this connection is closed.

Returns
The cached connection, or nullptr if this proxy doesn't have a cached connection. The returned connection can be closed.
Remarks
A proxy with connection caching disabled (see ice_connectionCached) never caches a connection: for such a proxy, this function always returns nullptr. This function also returns nullptr when this proxy reaches its target object through collocation optimization (see ice_collocationOptimized): collocated invocations don't use a connection.