Archived

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

Ice 3.1: Communicator.setDefaultContext()

Hi!

I installed the latest Ice packages a couple of minutes ago and tried to recompile some of our code.

Unfortunately, the setDefaultContext() function seems to be missing in the communicator and I cannot find no info on why it is missing and how it was replaced.

Could you please post some info on this? This function is really useful so I hope that it wasn't removed in this release without new functionality for such things...

regs,

Stephan

Comments

  • mes
    mes California
    Hi Stephan,

    Please see section 30.3 in the Ice 3.1.0 manual for information on how to configure a communicator with a default context. Briefly, you now need to create an instance of InitializationData, which contains the member defaultContext, and pass that structure to initialize.

    Take care,
    - Mark
  • Hi Mark!

    Thanks for the hint. However, how can I modify the default context during runtime? We are frequently using contexts to pass login cookies from client to server because it's much simpler to use in some cases than Glacier2.

    I.e., I first use the communicator without a certain context and then have to modify it during runtime. Imho that's the normal usage of the default context.

    Stephan
  • We will discuss this change internally to see what we can do.

    For the time being, the only suggestion I can make is to revert back to Ice 3.0.1.

    Cheers,

    Michi.
  • Could you make it possible to modify the initialization structure after the communicator is initialized? This might not only make sense for the default contxt but for other structure items as well.

    To put it in other words: why is it called 'initialization data' structure and not 'configuration data' structure?

    Hope that you can make available a patch for 3.1.

    regs,

    Stephan
  • bernard
    bernard Jupiter, FL
    stephan wrote:
    Could you make it possible to modify the initialization structure after the communicator is initialized?

    No, that's not possible. The whole point of this InitializationData parameter is to provide one-off data to the communicator. After initialization, the communicator can read these members without synchronization since it knows they can't change.

    Cheers,
    Bernard
  • hmm. ok, I understand.

    As you have left out the default locator and the router of the initialization structure because they might change during runtime (I'm not sure whether runtime changes happen with default locators but anyway), you should probably also remove the default context from the initialization structure and provide separate getters/ setters for it as it was before.

    Stephan
  • bernard
    bernard Jupiter, FL
    Hi Stephan,

    I've just posted a patch that restores setDefaultContext.

    Cheers,
    Bernard
  • Hi Bernard,

    thanks a lot for this patch. I used a quick hack in the meantime, creating two communicators in a row (one for getting the session context, the other one for the real business) but that obviously sucked :) So it's really good that we can now use the old code again!

    regs,

    Stephan