This forum has been archived. Please start a new discussion on GitHub.

Proxy Colocation Optimization

I think I'm having some trouble understanding when Ice chooses to use colocation optimization for proxies. I've created a quick sample program to test it:
class Test(Ice.Locator):
  def findAdapterById_async(self, cb, id, current = None):

id = Ice.stringToIdentity('blah')
c = Ice.initialize(sys.argv)
oa = c.createObjectAdapterWithEndpoints('test', 'tcp -h localhost')
oa.add(Test(), id)
prx = oa.createDirectProxy(id)
prx = Ice.LocatorPrx.checkedCast(prx)

When I run this with Ice.Trace.Network=2 it shows a tcp connection being made to the Object Adapter. I thought it wouldn't do this since I'm using a direct proxy that refers to an adapter in my own process. Is this not correct?


  • mes
    mes California
    Hi Tim,

    Ice would use collocation optimization in your example if you were using C++, Java, or .NET, but collocation optimization is not currently supported in Python. It's not a limitation of the Ice extension, but rather a limitation in the Ice run time. Changing this situation is on our TODO list, but it's not a high priority at present.

    Take care,
  • To what extent can collocation optimization be applied to IceStorm? Is there a way for me to fire up the topic manager programmatically from C++, so that it lives on the same communicator as my servant classes that do most of the publishing?
  • matthew
    matthew NL, Canada
    At present IceStorm cannot use the collocation optimization because it uses the Blobject interface internally, which does not support collocation optimized calls.