Home Help Center

Proxy Colocation Optimization

tctimmehtctimmeh Member Tim CourtOrganization: Enbridge PipelinesProject: Historical Data Retriever
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):
    cb.ice_response(None)

id = Ice.stringToIdentity('blah')
c = Ice.initialize(sys.argv)
oa = c.createObjectAdapterWithEndpoints('test', 'tcp -h localhost')
oa.add(Test(), id)
oa.activate()
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?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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,
    Mark
  • aronnaxaronnax Member Leo SingerOrganization: University of MarylandProject: Autonomous underwater vehicle AI
    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?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    At present IceStorm cannot use the collocation optimization because it uses the Blobject interface internally, which does not support collocation optimized calls.
Sign In or Register to comment.