Implementing Close Callback for Client Disconnect in Mixed Version Environment #2738
-
I am seeking assistance on how to implement a Close Callback when a client disconnects from the server. The challenge is that our client is developed using Ice version 3.7.10, while the server is running on Ice version 3.3.1. Unfortunately, we do not have access to the server's code. Could you please advise on the best approach to achieve this functionality under these circumstances? If possible, providing an example similar to your Session example would be incredibly helpful. Thank you for your time and assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, The client close callback is independent of the server. It is just a matter of calling The C++ Glacier2/simpleChat uses this to detect if the session has been destroyed: |
Beta Was this translation helpful? Give feedback.
In older versions, we used to have the client periodically call a server operation using a timer task, and then the server will cleanup the client if it didn't make any calls within the expected timeout.
See for example the 3.4 version of the Ice/session demo https://github.com/zeroc-ice/ice-demos/blob/3.4/demo/Ice/session/Client.cpp