<listen> element of the configuration file

Ralf Habacker ralf.habacker at freenet.de
Thu Mar 8 03:08:23 PST 2007


Luigi Paioro schrieb:
> I've never put my hands in D-Bus core code before, anyway...
>
> Havoc Pennington wrote:
>> So we can do the same thing on unix and windows for this, right?
>
> I've tried to do for Linux something like what Ralf did for Windows,
> and actually the daemon seems to run....
>
>> In any case, the important thing is to be sure
>> transport_get_address() includes the port that was chosen, so the
>> daemon can print its new address and the port is in
>> DBUS_SESSION_BUS_ADDRESS
>
> In fact, with only that simple change DBUS_SESSION_BUS_ADDRESS results
> wrong (it has port=0). Anyway I've looked for the actual port using
> netstat, and setting up DBUS_SESSION_BUS_ADDRESS manually everything
> seems to work. Now I think it remains only to modify
> _dbus_transport_new_for_tcp_socket and _dbus_server_new_for_tcp_socket
> ... but I'm not sure how...
search for getsockname() in http://webcvs.freedesktop.org/dbus/dbus/dbus/dbus-sysdeps-win.c?revision=1.1&view=markup where a kind of autolaunch protocol support is provided. 
It saves the address in a shared buffer, which is read out by the dbus client and used to connect to the server 

server: 
_dbus_listen_tcp_socket
-> listen
-> getsockname  (get real address and port)
->_dbus_daemon_init  (save address in shared buffer)

	
client: 
-> _dbus_get_autolaunch_address (get autolaunch address)

Ralf 



More information about the dbus mailing list