Archived
This forum has been archived. Please start a new discussion on GitHub.
proper self-destroy of a Glacier2::Session
Hi,
I've got a class which subclasses Glacier2::Session. This class acts like a bridge: it interacts with the client on one side and with some other Ice-Applications on the other side.
The wanted behaviour is: if the session is unable to call a method either on the server-side or the client-side (after a few tries) the session should be destroyed.
How to properly destroy the session within the code of the SessionImpl? Another Ice-Application is able to destroy by calling the destroy-method on the SessionProxy but inside the SessionImpl I am only able to call my local implemented destroy-function which does not result in destroying the Session at all.
The only possiblity I can imagine is to wait for inactivity-timeout but there has to be a better way
I've got a class which subclasses Glacier2::Session. This class acts like a bridge: it interacts with the client on one side and with some other Ice-Applications on the other side.
The wanted behaviour is: if the session is unable to call a method either on the server-side or the client-side (after a few tries) the session should be destroyed.
How to properly destroy the session within the code of the SessionImpl? Another Ice-Application is able to destroy by calling the destroy-method on the SessionProxy but inside the SessionImpl I am only able to call my local implemented destroy-function which does not result in destroying the Session at all.
The only possiblity I can imagine is to wait for inactivity-timeout but there has to be a better way
0
Comments
-
Hi Thomas,
Your session manager's create operation receives a proxy for a SessionControl object. You can pass this proxy to your session implementation, and it can invoke destroy on the SessionControl proxy when it needs to destroy the session.
Regards,
Mark0