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

Client connecting to multiple glacier2 routers

I am trying to write a sort of port mapper application. I would like my client to connect to a well known port (which will be a glacier2 router), and essentially request the connection details for a particular "service" (this service will also be behind a glacier2 router). I am having difficulty creating a connection to a second glacier2 router though. My code to create a connection to a second router is something like
Ice::ObjectPrx proxy = communicator()->stringToProxy("Glacier2/router:ssl -p 10006");
cout << "aaa" << endl;
Ice::RouterPrx routerPrxy = Ice::RouterPrx::checkedCast(proxy);
cout << "bbb" << endl;
Glacier2::RouterPrx router = Glacier2::RouterPrx::checkedCast(routerPrxy);

However I get the following...
./client: SslTransceiver.cpp:288: Ice::ConnectionLostException:
connection lost: recv() returned zero
....before "bbb" is printed

Essentially what I would like my client to do is to simply connect to the portmapper service, get the connection details, and then connect to the service provided. Any hints about how to go about this would be useful.

Thanks in advance for the help


  • benoit
    benoit Rennes, France
    If you've set the Ice.Default.Router property, Ice is most likely trying to route the request to the first router. You should make sure that the router proxy doesn't use the default router by calling ice_router(0):
    Ice::ObjectPrx proxy = communicator()->stringToProxy("Glacier2/router:ssl -p 10006")->ice_router(0);

    Let us know if this doesn't solve this problem!