Re: Problems with dbus_connection_borrow_message

Simon McVittie <simon.mcvittie-ZGY8ohtN/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Collabora Ltd.
Message-ID <[email protected]>
Before getting into specifics, did you see the bit in the documentation 
that points out that libdbus is a low-level library and is painful to 
use? You would probably be better off with GDBus (part of GLib) or 
QtDBus (part of Qt), which interoperate with libdbus and are a lot 
easier: in particular, they integrate nicely with the main-loop 
conventions of their respective frameworks.

On 24/02/15 11:54, itchy_2390 wrote:
>    DBusMessage *pMsg = dbus_connection_pop_message(Conn);
...
>    pMsg = dbus_connection_borrow_message(Conn);

These are low-level functions that you probably shouldn't be using, even 
if you are using libdbus. The usual way to receive signals via libdbus 
is to add a "filter function", then "dispatch" the connection by either 
hooking it up to a main loop or calling 
dbus_connection_read_write_dispatch().

>        if (dbus_message_is_signal(pMsg, iface, signal_name))
...
> But now I never get signals.
> What Am I doing wrong?

Are you using the right interface name?

Are you using the right signal name?

Did you ask to receive the signals you wanted, by adding a match rule?

-- 
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.