From: Jason, J. <jam...@in...> - 2010-10-20 22:10:46
|
Apologies if this has been discussed before, but I couldn't find what I needed in a quick search of the archives. If it is there, simply pointing me to the relevant discussion thread would be great. I have a class that implements the adaptor and I would like to do the following: - detect when a client disconnects from my session bus (either by cleanly shutting down or even if it crashes) - obtain the client that is sending a message (i.e., calling one of my exported methods) The reason I would like to do this is that when a client calls some of my exposed methods, I allocate some resources on the client's behalf. When the client calls one of these methods, I need to determine the unique client that is requesting it. I need to know when the client disconnects (or dies) so that I can look at my held resources and clean up the ones that have been created on behalf of the client. A quick perusal of the header files and mapping out the inheritance hierarchy for the classes, I don't see how I can get from my class that derives from *_adaptor and DBus::ObjectAdaptor to a class that can give me this information. I see that the DBus::Server class has an on_new_connection callback, but that doesn't appear to be what I want. Can someone point me in the right direction? Thanks. Jamie ---------------------------------------------------------------- Jamie Jason (jam...@in...) "I say this from the bottom of my heart, that if you don't root for the Dodgers, you might not get into Heaven." - Tommy Lasorda All opinions expressed are: 1. Entirely my own. 2. Not necessarily shared by my employer. 3. Unencumbered by the thought process. ---------------------------------------------------------------- |