Dbus method call sent but no reply got

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Sep 17 02:19:33 PDT 2013


On 16/09/13 06:59, Fei Zheng wrote:
> I need your help to resolve a problem about making method call but no
> reply got.

I strongly recommend using GDBus or QtDBus if possible. libdbus is a
relatively low-level library.

>	signal(SIGALRM, sigHandler);

It is not safe to call the majority of library functions, including
anything that might allocate memory and virtually everything in libdbus,
in a POSIX signal handler. See signal(7) on a Linux system, specifically
the section "Async-signal-safe functions".

Despite the similarity in terminology, you don't need to use POSIX
signals in D-Bus - D-Bus signal messages are not the same thing. I
recommend using a poll()-, select()- or epoll-based main-loop, such as
the one provided by GLib or QtCore. GDBus and QtDBus integrate
particularly well with their respective main loops.

If you absolutely need to use libdbus, Avahi might be a useful reference
for how to integrate libdbus with a main loop.

    S



More information about the dbus mailing list