Home Help Center

Server returning an IceGrid::Session proxy

BorlecBorlec Member Boris LecourtOrganization: ISISProject: Integration Bench
Hello !

Is it possible for a server to create and return a proxy to an IceGrid::Session and have the client keepAlive the returned session ?

I tried that :
- the session in the server is well created (I can invoque setAllocationTimeout for example)
- but the client got the exception ObjectNotExist when invoquing keepAlive or setAllocationTimeout .

What does wrong ?
Thanks !


  • BorlecBorlec Member Boris LecourtOrganization: ISISProject: Integration Bench
    Actually, my code is slightly different from described above...

    In fact, it is a client which create the IceGrid session and give it to a server:
    registry = IceGrid::RegistryPrx::checkedCast(ic->stringToProxy("SYSTEM/Registry"));
    session = registry->createSession("root","...");

    The interface of the server :
    interface ... {
        int InstanciateAndAllocateNewServer(IceGrid::Session* session);

    And the implementation of the server interface :
    Ice::Int ...::InstanciateAndAllocateNewServer(const ::IceGrid::SessionPrx& session,...) {
        // exception Ice::ObjectNotExistException

    Ice version 3.3.1 on Windows XP

    Tanks in advance for your help !
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    The IceGrid session object is tied to the connection between the client and the IceGrid registry so other processes can't invoke on the Ice session proxy. This ensures that only the client which was authorized to create the session uses it. Why don't you have the server create the session itself on behalf of the client and implement a session facade for the client to invoke on the server?

    We demonstrated this in the issue 18 and 19 of the "Ice Connections" newsletter. I also recommend checking out the issue 16 and 17 for more background on the MP3 encoder demo used to illustrate these articles. To access the newsletter archive, follow this link.

  • BorlecBorlec Member Boris LecourtOrganization: ISISProject: Integration Bench
    OK, I understand, thanks for your answer.
    Bye !
Sign In or Register to comment.