Problems with dbus_connection_borrow_message
itchy_2390
itchy_23 at gmx.de
Tue Feb 24 03:54:44 PST 2015
Hello,
I have a problem with dbus_connection_borrow_message and hope you could help
me.
I had a code that did this:
dbus_connection_read_write(Conn, 0);
DBusMessage *pMsg = dbus_connection_pop_message(Conn);
This worked well, but I have the problem that sometimes the pMsg that I get
is not a signal and when I pop it from the queue I get a timeout from my
other thread that is waiting for this messages that he never gets because
its not there anymore. So now I thought I first look at the signal to
confirm this signal is for me.
I tried
dbus_connection_read_write(Conn, 0);
pMsg = dbus_connection_borrow_message(Conn);
if (pMsg != NULL)
{
if (dbus_message_is_signal(pMsg, iface, signal_name))
{
dbus_connection_steal_borrowed_message (Conn, pMsg);
//do something with the msg
dbus_message_unref(pMsg);
}
else
{
dbus_connection_return_message(Conn, pMsg);
}
}
But now I never get signals.
What Am I doing wrong?
Thanks for the help.
--
View this message in context: http://free-desktop-dbus.2324887.n4.nabble.com/Problems-with-dbus-connection-borrow-message-tp13793.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.
More information about the dbus
mailing list