"The connection is closed" with g_dbus_connection_new_for_address and TCP/IP

Lars Hanisch dvb at flensrocker.de
Mon May 20 02:44:38 PDT 2013


Hi,

 I'm running an additional dbus-daemon with the attached configuration like this:

dbus-daemon --config-file=network.conf --address="tcp:host=`/bin/hostname`,bind=*,port=0" --print-address >
network-address.conf

 network-address.conf will then contain something like this:

tcp:host=hdvdr,port=36761,guid=b3de621fef8d1ee911325c2900000016

 I read the file and extract the host and port with dbus_parse_address, dbus_address_entry_get_method and
dbus_address_entry_get_value. If I use libdbus with dbus_connection_open, dbus_bus_register and dbus_bus_request_name
everything's fine and I can own a busname and use it like a connection to the system or session bus.

 Due to other reasons I must port this to GDBus. As I understand the documentation I have to use
g_dbus_connection_new_for_address with the address "tcp:host=hdvdr,port=36761". I tried several flags like
G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION (which should be the right one, I think), but
g_dbus_connection_new_for_address_finish always returns with the error "The connection is closed".

 g_dbus_is_supported_address has no problem with the address. Also I tried to split the calls and use
g_dbus_address_get_stream and g_dbus_connection_new, but the result is the same.

 g_bus_get for system and session bus are working as expected.

 I'm nailed to Ubuntu Precise with dbus 1.4.18 and GLib 2.32.

 Have you any advice for me, how to debug this? Or any hints what the reason for this connection error is?

Thanks!
Lars.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130520/bd011523/attachment.html>


More information about the dbus mailing list