Archived
This forum has been archived. Please start a new discussion on GitHub.
Ice::ConnectionLostException in client with callback
rpeters
in Help Center
Having created a callback interface in a client, and attaching it to a server, I can see the Ice::ConnectionLostException in the client debug trace when the server goes away. I would like to catch this, but I dont see how. Otherwise the client is just dead.
I read the FAQ and other threads regarding Ice::ConnectionLostException, but I dont see any solution there.
thanks
Rich
I read the FAQ and other threads regarding Ice::ConnectionLostException, but I dont see any solution there.
thanks
Rich
0
Comments
-
You cannot catch this exception. Perhaps this FAQ is useful to help you. (Note that a callback is just like any other call, except that client and server reverse roles, so if you read this FAQ, for your specific case, you must reverse the meaning of client and server.)0
-
Rich,
Please note that this is nothing Ice specific. You cannot rely on a connection closure callback to re-establish a connection back to the server for the reasons outlined in the FAQ to which Marc linked.
Depending on the structure of your application there are multiple solutions. One possible solution is to make the callback persistent in the server. When the server comes back it starts calling back on the clients which were previously connected. This is how IceStorm works.
If persistence is not suitable in your case you could establish a session with the server in question. Once the session goes away (which you can reliably detect) then you start to re-establish the session. If you need an example of how to do sessions check demo/Ice/session.0
