How are connections shared among proxies?

There is a long answer and a short answer to this question. The long answer includes an explanation of how the Ice run time keeps track of connections.

Each proxy stores information about the endpoint(s) at which its object can be reached. When a client invokes an operation on a proxy, the Ice run time first checks whether it already has a compatible open connection to the proxy's selected endpoint. If so, it re-uses that connection; otherwise, it establishes a new one. Once established, the run time stores connections in an internal connection table that keeps track of all open connections. That way, a client can use thousands of proxies while using only as many connections as there are distinct endpoints in these proxies. (Note that, if proxies have different connection timeout values, the Ice run time creates a separate connection, that is, for proxies to objects at the same endpoint, there are as many connections as there are distinct timeouts.)

Connections are closed when, for example, you destroy a communicator and when a request times out or encounters a communication failure. You can also explicitly close a connection via a proxy's associated Connection object. If you have Active Connection Management (ACM) enabled, the Ice run time periodically closes connections that have been idle for some time, so connections are not held open indefinitely.

The short answer as to how connections are shared is "as much as possible" — the Ice run time never opens a connection unless it has to and, if you enable ACM, automatically closes connections when they are no longer needed.

See Also