Issues while using DBUS over TCP
Schmottlach, Glenn
GSchmott at harmanbecker.com
Wed Aug 6 08:19:14 PDT 2008
Simon -
Thanks for the tip and explanation. I made your suggested modification
and it worked! I am not sure if I was having a different problem before
but I certainly like your cleaner solution.
With that said, I wish there was a HOWTO or Wiki somewhere that
addresses the use of DBUS over TCP. DBUS is potentially a very powerful
framework with characteristics that could make it very useful in a
controlled embedded environment (especially for test and verification of
services hosted on the target platform). I've seen plenty of posts of
people all *trying* to do the same thing but no concrete solutions or
guidance given by the developers (I guess it is viewed as being out of
the scope of the original intent/purpose of DBUS). The goal of my
original post was to at least provide some details of what I got to
work. As hoped, it also generated some corrections which improved the
approach.
Too bad there isn't a configuration option within session.conf (or
system.conf) that enables anonymous connections without requiring the
modifications to the source code and rebuilding the daemon. It seeems
that this would be a common enough request that inclusion in the main
code-base would be worthwhile.
-----Original Message-----
From: dbus-bounces at lists.freedesktop.org
[mailto:dbus-bounces at lists.freedesktop.org] On Behalf Of Simon McVittie
Sent: Wednesday, August 06, 2008 10:41 AM
To: dbus at lists.freedesktop.org
Subject: Re: Issues while using DBUS over TCP
On Wed, 06 Aug 2008 at 10:09:06 -0400, Schmottlach, Glenn wrote:
> This is a hack (particularly the TcpSessionBus) class and obviously
> could use some refinement. The default implementation of the Python
> SessionBus class does not allow you to specify a TCP address and
> required this work-around.
... that's because you're not using "the" session bus (for which
SessionBus
is suitable), you're using an entirely different dbus-daemon (which
happens to be someone else's session bus, but the client code doesn't
care). So, don't use SessionBus, use BusConnection directly.
> Also, the "_connection" property of the
> TcpSessionBus class is important or the Python Dbus implementation
will
> not wire up the bus class so that it can be used to receive
> signals/events from the service.
If this still doesn't work when you're using BusConnection, please file
a
bug - it ought to work without you having to define a _connection
property.
You should be able to do this:
remote_bus = BusConnection(addr, mainloop)
remote_bus.get_object(...)
remote_bus.connect_to_signal(...)
Simon
*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************
More information about the dbus
mailing list