Query using D-bus

Keyur keyur.patel at einfochips.com
Thu Dec 6 20:50:58 PST 2012


Hi,

Thanks for help,

but my client application is in c++ and i am using libdbus-c++ 0.9.0

any suggestion on that how to get notified that my Qt server application 
has crashed ?

On 06/12/2012 9:03 PM, Thiago Macieira wrote:
> On quinta-feira, 6 de dezembro de 2012 12.01.55, Simon McVittie wrote:
>> If it adds appropriate match rules, the client will get a
>> NameOwnerChanged signal from the dbus-daemon, for each of the bus names
>> that were owned by the Qt application, telling it that the bus name's
>> owner has changed to "". Something like this:
>>
>>      NameOwnerChanged("com.einfochips.keyur.MyService", ":1.42", "")
>>      NameOwnerChanged(":1.42",                          ":1.42", "")
>>
>> (The parameters are the name being owned, the old owner and the new
>> owner, in that order. Every unique bus name is considered to be its own
>> owner.)
>>
>> The library you're using in your client application (which one are you
>> using?) should hopefully give you a high-level way to subscribe to
>> NameOwnerChanged, whose name will probably be something involving
>> "watching names". In GDBus it's g_bus_watch_name(),
>> g_bus_watch_name_on_connection() etc.
>>
>> If it doesn't have that, the next best thing is if it gives you a way to
>> subscribe to signals. In GDBus this is g_dbus_connection_signal_subscribe().
> With QtDBus, you connect to signals in one of two ways:
>
> QDBusConnection::connect, a low level mechanism that allows you to specify
> many items of the connection, including an argument match list.
>
> QObject::connect and passing a QDBusInterface object as the sender, which
> might be more at home for Qt developers.
>
> However, specifically for watching for names on the bus, there's a
> QDBusServiceWatcher class which should be used, as it will do the right thing
> with the minimal signal subscription on the bus, avoiding unnecessary process
> wakeups.
>
>> In C/C++ code, I recommend using either GDBus (part of GLib) or QtDBus.
>>
>>
>> _______________________________________________
>> dbus mailing list
>> dbus at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dbus

-- 
Regards,
Keyur Patel


---------------------------------------------------------------------------------------------
Notice: 
This message has been scanned by Trend Micro Mail Security scanner and is believed to be clean
---------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20121207/ab131db0/attachment.html>


More information about the dbus mailing list