[Interest] QDBusConnection behavior after DBus Daemon has been re-started
thiago.macieira at intel.com
Wed Jun 5 23:24:36 CEST 2013
On quarta-feira, 5 de junho de 2013 16.55.40, Miller, Doug wrote:
> --sorry for the earlier mess
> Take a simple application that establishes a connection via
> QDBusConnection::sessionBus(). If the DBus Daemon is shut down and
I'm sorry, but we can stop here. There's no condition in which the D-Bus
daemon for the session bus is restarted. If the daemon shuts down, that means
the session has just ended your application is expected to exit. Do not expect
it to come back.
> If one uses connectToBus(const QString & address, const QString & name) a
> similar problem exists even if disconnectFromBus(const QString & name) is
> first called with the same name and after the daemon has been restarted.
> It is like there is a reference that can't be cleared. If
If you're using a private bus, then your rules apply and it might restart. But
in order for this to work, you need to call disconnectFromBus first.
Note that there is no unit test in the QtDBus test suite that deals with a bus
disconnecting. I really have no idea how you'll be notified of that. I think I
wrote some code for that back in 2006, but I don't remember it anymore. As I
said, this is an extremely rare condition.
> The loss of the DBusDaemon can easily occur when the daemon is running on
> another machine and connections are via a network. Most uses of DBus have
> the daemon running locally so I guess this is why the problem has never
> been detected before.
There's no remote session bus either. This use-case does not exist in D-Bus.
The daemon is always local and defines what the current session is. One session
= triad (user, graphical display, machine).
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the Interest