|
From: Jesús R. de I. <jes...@ha...> - 2008-09-17 08:47:23
|
It seems that there is a problem when the glib main loop must attend a dbus signal just after it
called a dbus method.
If that dbus signal handler emits a sigc signal, the last signal is actually never emitted (or at least,
a slot connected to it is never executed)
I have the following scenario:
Actors:
- testserver: A server of a simple service
- testclient 1 & testclient 2
test svc server
.------------------------------------.
| .-------------------------------. |
| | handle_key_pressed_event | |
.------->| dbus: _signal_mode_switched | |
| | | | |
| | '-------------------------------' |
| | | |
| '------------------|-----------------'
| |
| |
.----------------------------. | .----------------------------.
| sigc: signal_mode_switched |<----------------->| sigc: signal_mode_switched |
| | | |
| .-------------------.| | .-------------------. |
| | || | | | |
| | on_mode_switched: || | | on_mode_switched: | |
| | change label || | | change label | |
| '-------------------'| | '-------------------' |
| | | |
'----------------------------' '----------------------------'
test svc client 1 test svc client 2
- When the user clicks on the single program button, the client 1 calls the handle_key_pressed_event
dbus method of the server.
- Then the server emits the _signal_mode_switched dbus signal, which is received by both clients.
- On the clients, the _signal_mode_switched signal emits the sigc signal_mode_switched.
- on_mode_switched, which is connected to the signal_mode_switched, simply changes
a gtk label.
The problem is, on_mode_switch is only called on the client that didn't sent signal_mode_switched.
I have attached some sample code.
System Info:
Centos 5.2
dbus-python-0.70-7.el5
dbus-1.0.0-7.el5
dbus-glib-0.70-5
dbus-glib-devel-0.70-5
dbus-devel-1.0.0-7.el5
dbus-x11-1.0.0-7.el5
pygtk2-2.10.1-12.el5
gtk2-engines-2.8.0-3.el5
pygtk2-libglade-2.10.1-12.el5
libgtk-java-2.8.7-3.el5
gtkspell-2.0.11-2.1
gtksourceview-1.8.0-1.fc6
gtk2-2.10.4-20.el5
gtk2-devel-2.10.4-20.el5
gtkhtml3-3.16.3-1.el5
gtk-doc-1.7-1.fc6
gtkhtml2-2.11.0-3
gtkmm24-2.10.10-1.el5
pygtk2-codegen-2.10.1-12.el5
usermode-gtk-1.88-3.el5.1
authconfig-gtk-5.3.21-3.el5
gtkmm24-devel-2.10.10-1.el5
gnome-python2-gtksourceview-2.16.0-2.el5
pygtk2-devel-2.10.1-12.el5
latest dbus-c++ from git repo
--
Mit freundlichen Grüßen
Jesus Ruiz de Infante
(Entwicklung)
HALE electronic GmbH
Eugen-Müller-Straße 18, 5020 Salzburg, Austria
Tel: +43 (662) 439011 0
Fax: +43 (662) 439011 9
jes...@ha...
Firmenbuchnummer: FN 66801m HG Salzburg
--
Scanned by MailScanner.
|
|
From: Jesús R. de I. <jes...@ha...> - 2008-09-22 09:01:21
|
Oops, I attached the wrong test client! Here are the sources again. Also, I forgot to clarify that the point of starting two clients is that only one of them gets to call the sigc callback after receiving the dbus signal, namely the one that didn't start talking with the server. The result is the same independently of the number of clients. All work as supposed except the one calling handle_key_pressed_event() on the server. Thanks, -- Mit freundlichen Grüßen Jesus Ruiz de Infante (Entwicklung) HALE electronic GmbH Eugen-Müller-Straße 18, 5020 Salzburg, Austria Tel: +43 (662) 439011 0 Fax: +43 (662) 439011 9 jes...@ha... Firmenbuchnummer: FN 66801m HG Salzburg -- Scanned by MailScanner. |
|
From: Jesús R. de I. <jes...@ha...> - 2008-09-22 12:10:03
Attachments:
testgtkclient2.c
|
I have prepared a quick and dirty version of my testgtkclient in C, using dbus-glib, and all works as expected. Could this be a bug in dbus-c++? What am I doing wrong? -- Mit freundlichen Grüßen Jesus Ruiz de Infante (Entwicklung) HALE electronic GmbH Eugen-Müller-Straße 18, 5020 Salzburg, Austria Tel: +43 (662) 439011 0 Fax: +43 (662) 439011 9 jes...@ha... Firmenbuchnummer: FN 66801m HG Salzburg -- Scanned by MailScanner. |
|
From: Jesús R. de I. <jes...@ha...> - 2008-09-22 15:35:37
|
I have prepared a quick and dirty version of my testgtkclient in C, using dbus-glib, and all works as expected. Could this be a bug in dbus-c++? What am I doing wrong? -- Mit freundlichen Grüßen Jesus Ruiz de Infante (Entwicklung) HALE electronic GmbH Eugen-Müller-Straße 18, 5020 Salzburg, Austria Tel: +43 (662) 439011 0 Fax: +43 (662) 439011 9 jes...@ha... Firmenbuchnummer: FN 66801m HG Salzburg -- Scanned by MailScanner. -- Scanned by MailScanner. |