Connecting to dbus over tcp
I wrote a simple python program to play and pause banshee music player.
While its working on my own machine, I have trouble doing it to a remote computer, connected to the same router (LAN). I edited the session.conf of the remote machine, to add this line: Code:
<listen>tcp:host=localhost,port=12434</listen> Code:
import dbus Traceback (most recent call last): File "dbus3.py", line 4, in <module> bus_obj=dbus.bus.BusConnection("tcp:host=localhost,port=12434") File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 125, in __new__ bus = cls._new_for_bus(address_or_type, mainloop=mainloop) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket "localhost:12434" Connection refused What am I doing wrong here? should i edit /usr/lib/python2.7/dist-packages/dbus/bus.py |
How did you make "dbus" listen to that port on the other machine?
Editing standard packages is a no-go. The failure is always in your script or at layer 8 and only in very, very rare cases in the standard modules. |
Quote:
I added this line to session.conf of the remote machine: <listen>tcp:host=localhost,port=12434</listen> obviously, I am doing something wrong here? apologies if it is a stupid mistake. |
Quote:
|
I doubt you can do that at all.
But having ....BusConnection("tcp:host=localhost,port=12434") it just can't even try to connect. Change "localhost" to remote hostname or remote IP "dbus" is designed for local communication. Allbeit there are plans to extend it to network communication. Solutions up to now just got problems with authentication. Think about that: What should the remote box do to avoid that someone from the alpha centauri just plays alien music? |
Quote:
Quote:
should i also do that for the session.conf file? (in /etc/dbus-1) I am confused |
ok, here is the deal
when i add <listen>tcp:host=192.168.1.7,port=12434</listen> to to /etc/dbus-1/session.conf, then reboot, hoping it would start listening on reboot, It never boots. It gets stuck on loading screen and occasionally, a black screen with the following text flashes: Pulseaudio Configured For Per-user Sessions Saned Disabled;edit/etc/default/saned so, when i go ctrl+alt+f1 , change session.conf to original state and reboot, it boots properly. Whats all that about? How can I make dbus daemon listen for tcp connections, without encountering problems? |
All times are GMT -5. The time now is 11:45 AM. |