Home Help Center

Glacier2 C++ client without runWithSession

evgkevgk Member Evgeny KlunkoOrganization: ISTP SB RASProject: telescope control system

I'm studing ICE as a possible replacement for Microsoft RPC middleware in our project (telescope control system, C++ only). Point #1 of the plan is to implement a couple of new interfaces with ICE. I'm impressed with Glacier2 technology so I decide to use it. I have studied Glacier2 demo but I think it would be undesirable to wrap a whole client apllication into Glacier2::Application::runWithSession() for a number of reasons (one of them is that we prefer to keep communication staff in a helper DLL). The desirable usage seems to be as follows:
1. Create some persistent object(s) on application startup to initialize ICE runtime.
2. Create proxy object for given server interface.
3. Call proxy's methods to do some job on the server.
4. Destroy proxy.
5. Destroy persistent objects on application shutdown (deinitialize ICE runtime).

Am I right or not I'd like to avoid the limitation to do (2)-(4) from within runWithSession(). I want just to use ICE middleware not to wrap my application into it. Is it possible? I've found helper classes of this kind for Java and C# GUI apps, but not for C++. Why?

OK, the disadvantage is that we must wrap every call into try-block to catch ICE exceptions (and convert them into our exceptions, for example).

Best wishes,


  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    As you've seen the helpers for Glacier2 provided in C++ are similar to Ice::Application and are not really suitable for writing applications which want to control their own main loop. I'm glad to hear that an implementation in C++ of the C# and Java style Glacier2 helpers in help would solve your problem. Fortunately, Ice 3.5 will contain a C++ equivalent of these helpers.

    Until Ice 3.5 is released please note that it isn't mandatory to use the Glacier2 helper classes. You can manually establish, keep alive and tear down the glacier2 session yourself in code as long as you follow the correct set of rules. The basic procedure is outlined in the Ice manual in the Glacier2 section.
Sign In or Register to comment.