Problems with dbus_connection_borrow_message

itchy_2390 <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
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.
_______________________________________________
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.