<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
<FONT SIZE="4">well, it seems that all relevant fd's are there. However, I still get the dbus timeout...</FONT><BR>
<FONT SIZE="4">Any clue appreciated.</FONT><BR>
<BR>
<FONT SIZE="4">Thanks</FONT><BR>
<BR>
<FONT SIZE="4">I attached the strace log, maybe someone can see it on the first glance</FONT><BR>
<BR>
<PRE>
write(1, &quot;tube state changed to&nbsp; : open\n&quot;, 30) = 30
write(1, &quot;Tube OPENED\n&quot;, 12)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 12
fcntl64(8, F_GETFL)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0x2 (flags O_RDWR)
fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK)&nbsp; = 0
fcntl64(8, F_GETFD)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0
fcntl64(8, F_SETFD, FD_CLOEXEC)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0
fstat64(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(8, F_GETFL)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0x802 (flags O_RDWR|O_NONBLOCK)
write(1, &quot;TUBE &lt;dbus.connection.Connection&quot;..., 54) = 54
poll([{fd=8, events=POLLOUT}], 1, 0)&nbsp;&nbsp;&nbsp; = 1 ([{fd=8, revents=POLLOUT}])
write(8, &quot;\0&quot;, 1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1
write(8, &quot;AUTH EXTERNAL 31303030\r\n&quot;, 24) = 24
fstat64(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(8, F_GETFL)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0x802 (flags O_RDWR|O_NONBLOCK)
write(1, &quot;&lt;ProxyObject wrapping &lt;dbus.conn&quot;..., 105) = 105
poll([{fd=8, events=POLLIN}], 1, 0)&nbsp;&nbsp;&nbsp;&nbsp; = 1 ([{fd=8, revents=POLLIN}])
read(8, &quot;OK 60da741365a226f57f3031414c6e9&quot;..., 2048) = 37
fstat64(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(8, F_GETFL)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0x802 (flags O_RDWR|O_NONBLOCK)
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLOUT}], 4, 24998) = 1 ([{fd=8, revents=POLLOUT}])
write(8, &quot;BEGIN\r\n&quot;, 7)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 7
fstat64(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
fcntl64(8, F_GETFL)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0x802 (flags O_RDWR|O_NONBLOCK)
writev(8, [{&quot;l\1\0\1\0\0\0\0\1\0\0\0[\0\0\0\1\1o\0\16\0\0\0/tv/vfre&quot;..., 112}, {&quot;&quot;, 0}], 2) = 112
writev(8, [{&quot;l\4\1\1\20\0\0\0\2\0\0\0G\0\0\0\1\1o\0\16\0\0\0/tv/vfre&quot;..., 88}, {&quot;\v\0\0\0Local hello\0&quot;, 16}], 2) = 104
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 24997) = 1 ([{fd=8, revents=POLLIN}])
read(8, &quot;l\1\0\1\0\0\0\0\1\0\0\0s\0\0\0\1\1o\0\16\0\0\0/tv/vfre&quot;..., 2048) = 136
read(8, 0x8f80310, 2048)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 0) = 0 (Timeout)
writev(8, [{&quot;l\2\1\1$\2\0\0\3\0\0\0\17\0\0\0\5\1u\0\1\0\0\0\10\1g\0\1s\0\0&quot;, 32}, {&quot;\37\2\0\0&lt;!DOCTYPE node PUBLIC \&quot;-//fr&quot;..., 548}], 2) = 580
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 24865) = 1 ([{fd=8, revents=POLLIN}])
read(8, &quot;l\2\1\1\243\0\0\0\2\0\0\0\17\0\0\0\5\1u\0\1\0\0\0\10\1g\0\1s\0\0&quot;..., 2048) = 195
read(8, 0x8f80310, 2048)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 0) = 0 (Timeout)
writev(8, [{&quot;l\1\0\1\0\0\0\0\4\0\0\0B\0\0\0\1\1o\0\16\0\0\0/tv/vfre&quot;..., 88}, {&quot;&quot;, 0}], 2) = 88
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 25000) = 0 (Timeout)
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, 0) = 0 (Timeout)
write(1, &quot;Error: (DBusException(dbus.Strin&quot;..., 253) = 253
poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN}], 4, -1 
</PRE>
<BR>
<BR>
On Thu, 2010-08-19 at 16:01 +0100, Alban Crequy wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
connect(8, {sa_family=AF_FILE, path=&quot;/tmp/dbus-gabble-eJmvd0ho&quot;}, 27) =0

So it connects fine to the D-Bus tube and use the file descriptor 8.
When your process is waiting in poll() or select(), is the file
descriptor 8 included in the list of fd to watch? If not, dbus-python
is not using the mainloop correctly... I don't remember the syntax, but
something like that:

from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
tube = dbus.connection.Connection(self.tube_addr,
  mainloop=DBusGMainLoop())

BR,
Alban

Le Thu, 19 Aug 2010 14:23:23 +0200,
tomw &lt;<A HREF="mailto:tomw@ubilix.com">tomw@ubilix.com</A>&gt; a &#233;crit :

&gt; Alban,
&gt; 
&gt; thanks for your quick reply,
&gt; 
&gt; the &quot;SERVICE&quot; is the service the tube was created for, e.g.
&gt; &quot;org.example.Service&quot; and I'm using a 1-1 DBus tube.
&gt; 
&gt; I was tracing the remote app with strace but it does not seem to
&gt; receive any communication on the socket. I guess I need to digg
&gt; deeper...
&gt; 
&gt; br, tomw  
&gt; 
&gt; On Thu, 2010-08-19 at 12:37 +0100, Alban Crequy wrote:
&gt; &gt; Le Thu, 19 Aug 2010 08:34:35 +0200,
&gt; &gt; tomw &lt;<A HREF="mailto:tomw@ubilix.com">tomw@ubilix.com</A>&gt; a &#233;crit :
&gt; &gt; 
&gt; &gt; &gt; Hi folks,
&gt; &gt; &gt; 
&gt; &gt; &gt; I'm trying to use a remote Object over a DBus tube. So far
&gt; &gt; &gt; everything works fine. The tube is open and upon the
&gt; &gt; &gt; tube_channel_state_change I get a dbus.connection.Connection
&gt; &gt; &gt; object with the related address like
&gt; &gt; &gt; unix:path=/tmp/dbus-gabble-6k8gfh-V. If I proceed then with: 
&gt; &gt; &gt; 
&gt; &gt; &gt; if state == TUBE_CHANNEL_STATE_OPEN:
&gt; &gt; &gt;             tube = dbus.connection.Connection(self.tube_addr)
&gt; &gt; &gt;             tube.add_signal_receiver(self.signal_cb)
&gt; &gt; &gt;             remote = tube.get_object(SERVICE, PATH)
&gt; &gt; 
&gt; &gt; What is &quot;SERVICE&quot; here? Are you using a 1-1 D-Bus tube or MUC D-Bus
&gt; &gt; tubes?
&gt; &gt; 
&gt; &gt; In D-Bus tubes (both 1-1 and MUC), there is no bus driver
&gt; &gt; implementing org.freedesktop.DBus, so there is no well-known names.
&gt; &gt; 
&gt; &gt; In the case of MUC D-Bus tubes, you can find the D-Bus unique name
&gt; &gt; (to use instead of &quot;SERVICE&quot;) of a contact with the &quot;DBusNames&quot;
&gt; &gt; property on your tube channel:
&gt; &gt; <A HREF="http://telepathy.freedesktop.org/spec/Channel_Type_DBus_Tube.html#org.freedesktop.Telepathy.Channel.Type.DBusTube.DBusNames">http://telepathy.freedesktop.org/spec/Channel_Type_DBus_Tube.html#org.freedesktop.Telepathy.Channel.Type.DBusTube.DBusNames</A>
&gt; &gt; 
&gt; &gt; &gt;             remote.Method(reply_handler=self.tube_reply_cb,
&gt; &gt; &gt; error_handler=self.tube_error_cb)
&gt; &gt; &gt; 
&gt; &gt; &gt; Calling Method on the remote object always creates a DBus timeout:
&gt; &gt; &gt; &quot;DBusException(dbus.String(u'Did not receive a reply...&quot;
&gt; &gt; &gt; The remote object is running on the DBUs and locally works like it
&gt; &gt; &gt; should. So, what am I missing here?
&gt; &gt; 
&gt; &gt; You can use strace on your application to see if it receives a D-Bus
&gt; &gt; message on the tube socket.
&gt; &gt; 
&gt; &gt; &gt; BTW, the telepathy framework is really a great piece of work
&gt; &gt; &gt; (once you grasp it :-) 
&gt; &gt; 
&gt; &gt; BR,
&gt; &gt; Alban
&gt; &gt; _______________________________________________
&gt; &gt; telepathy mailing list
&gt; &gt; <A HREF="mailto:telepathy@lists.freedesktop.org">telepathy@lists.freedesktop.org</A>
&gt; &gt; <A HREF="http://lists.freedesktop.org/mailman/listinfo/telepathy">http://lists.freedesktop.org/mailman/listinfo/telepathy</A>
&gt; 
&gt; 
_______________________________________________
telepathy mailing list
<A HREF="mailto:telepathy@lists.freedesktop.org">telepathy@lists.freedesktop.org</A>
<A HREF="http://lists.freedesktop.org/mailman/listinfo/telepathy">http://lists.freedesktop.org/mailman/listinfo/telepathy</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>