Archived

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

Glacier2+Callbacks

I'm working on a client/server system in C# that is required to use Glacier as the front end to handle firewall situations.... I'm using Glacier filtering and can connect into my server just fine... the fun starts when I try to do callbacks... I'm consistently getting NoEndpointExeption

I've fairly faithfully followed the Callback demo for glacier to setup the proxy, except for adding code to get the category from Glacier and modify the Identity used to create the proxy.

Could someone paste up some known working code that doesnt have all the decorations that the demo has, or give me a few hints what to check to see where I FUBAR'd my code ?? :) (just the client side... everything up to the point where the server makes the callback is working perfectly)

Comments

  • marc
    marc Florida
    If you have removed the code that sets the Glacier2-assigned category, then it's not surprising that callbacks do not work. Glacier2 relies on this category to route callbacks.

    The demo/Glacier2/callback demo is already very minimal. I'm afraid we don't have any example that is even simpler than this one.
  • Ok here is the critical code section...
    public ClientInterfaceI	Client = null;
    private Ice.Identity	InterfaceID;
    private ClientInterfacePrx	Interface = null; // this is the callback class
    private Glacier2.RouterPrx	Router = null;
    
    // other code here -- Client and Router initialized
    
    string category = Router.ice_getIdentity().category;
    
    Ice.ObjectAdapter adapter = communicator().createObjectAdapter("CallbackAdapter");
    
    InterfaceID = new Ice.Identity();
    InterfaceID.name = Ice.Util.generateUUID();
    InterfaceID.category = category;
    
    adapter.add(Client, InterfaceID);
    adapter.activate();
    Ice.ObjectPrx prx = adapter.createProxy(InterfaceID);
    Interface = ClientInterfacePrxHelper.uncheckedCast(prx);
    
    

    Interface is then passed to the server as a ClientInterfacePrx*

    any clues ??
  • marc
    marc Florida
    Apparently no router is configured for the object adapter. Do you set the property CallbackAdapter.Router? In the callback demo the client uses an OA with the name "Callback.Client", so the router is configured as:

    Callback.Client.Router=Glacier2/router:tcp -p 10005

    This means that in your code, where the name of the client's OA is "CallbackAdapter", you must have something like:

    CallbackAdapter.Router=... proxy to the Glacier2 router ...
  • You set up an endpoint when trying to do a bidirectional connection to Glacier ?? Thought the whole point was to make it use the existing connection...

    Very Confused !!
  • Thanks Loads !! got the right router settings now !!
  • marc
    marc Florida
    KE5CRP wrote:
    You set up an endpoint when trying to do a bidirectional connection to Glacier ?? Thought the whole point was to make it use the existing connection...

    Very Confused !!

    No, you don't set an endpoint. But you must configure the proxy of the router for each object adapter.