DBusServer accepted client close

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Thu Oct 4 20:52:43 UTC 2018


On Thu, 4 Oct 2018 17:10:06 +0800, Andy Green wrote:

> When I create the connection using eg gdbus, stuff
> that I allocate that I want to associate with the connection, has no
> obvious event on which it can be deallocated because the connection
> has ended.

How about setting a DBusNewConnectionFunction on your DBusServer object
<https://dbus.freedesktop.org/doc/api/html/group__DBusServer.html#gaa14d9109e04adccffd9a40460c28c53b>
which calls dbus_connection_set_data to set some dummy data together
with a DBusFreeFunction
<https://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#ga845b4942399f43dd4ac644de7cb9e3ff>.
Then when the free function is called (without you doing a
dbus_connection_set_data again on the same slot), then you know the
connection is going away.


More information about the dbus mailing list