|
From: Ignacy G. <sf...@qu...> - 2008-09-03 20:50:39
|
Hi, I'm playing with dbus-c++ for two days now and I stumbled upon a particular problem related to using DBus::Server. It seems that this part of the code needs some work and that most of the people simply don't care, since, please correct me if I'm wrong, it's used only in peer-to-peer communications (i.e. not going through dbus-daemon). Of course I could for now go along with using dbus-daemon and not care about DBus::Server that much, but I'm still wondering how to make that thing work right. A major problem with DBus::Server is the way DBus::Connection objects are dealt with and more generally the fact that there apparently is no clean way of cleaning up stuff on client disconnection. As for DBus::Connection instances, they obviously are never removed from the DBus::Server::Private::connections list. The thing is that after looking into the libdbus API and having searched through the mailing list archives, it seems to me that there is a deeper problem with detecting client disconnections. A watch does not hold any reference to the connection it's associated with and relying on connections (and also watches) to have an associated file descriptor (that might be used to match the one with the other) is not a good way to go, according to the API docs (a connection is not necessarily associated with a file descriptor). So at no point is there a way to associate a watch to its connection, so as to check whether it's still connected after a watch handling, or something like that. Do you see any way of achieving this? Ignacy -- /* This is not a comment */ |