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

Does glacier2 support bi-dir connections?

My current application uses bi-dir connections and I'm trying to add support for glacier2, but running into some problems. Does glacier2 support bi-dir connections?

Regards --Roland


  • Client<->glacier2 connections are always bi-directional. You can't even make them unidirectional. In contrast to setting up bi-directional connections manually, this all happens automatically with Glacier.

    However, code that attempts to manually set up a bi-directional connection between a client and a server won't work, because with Glacier there is no direct connection between a client and a server.
  • Hi Marc, So if I'm trying to add glacier2 support in my application that currenty uses bi-dir connections then should I guess the only difference would be, besides the glacier2 additions, to not invoke setAdapter(..). Will passing the proxy as an identity when registering with the server still work the same or do I need to also send the proxy as as proxy?

    Thanks again --Roland
  • You need to send a proxy as a proxy. You cannot use any of the manual bi-directional methods. You must let Glacier handle the bi-directional part.

    A manually set up bi-directional connection cannot work with any kind of router, including Glacier, because there is no direct connection between the client and the server. The client connects to Glacier, which then connects to the server. There might be many clients for which Glacier shares the same connection to a server (it acts as connection concentrator), but each client has its own bi-directional connection to Glacier.

    Note that only connections from clients to Glacier are bi-directional. There is no way to use a bi-directional connections between Glacier and servers. In fact, servers can be completely unaware of the existence of Glacier, and do no require any special code.

    There are several steps involved to make a client work with Glacier, including authentication/login, and using a special category for identities which is provided by Glacier. This is all described in detail in the Ice manual.
  • matthew
    matthew NL, Canada
    Also note that in connections 1 and connections 2 I wrote two articles about Glacier2. I encourage you to read them.
  • Hi Marc and Mathew, Thanks for all your help! I got it all working. Not sure you want to address this in the zeroc manual or if it is covered already. As you mentioned above, for applications that need to run using either bi-dir or glacier2 you need to have some different paths enabled as well as callback proxies that need to be registered with the server as either identities when using bi-dir connections or proxies when using glacier2. So I ended up adding a method registerClientCallbackAsProxy since registerClientCallback already existed. Not sure what the preferred method would be, but I could see a single method that supplies both the identity of the proxy and proxy and possibly a separate method enableBidirectionalConnections which would notify the server how to resolve the callback proxy.

    Thanks again for all your help.

    Regards --Roland