how to use dbus_connection_open
Wilson Khoo
wilson_ua at yahoo.com
Mon Apr 21 08:23:57 PDT 2008
I have not work with this interface before. below is the pseudo code of what I did. dbus_connection_open returns a valid g_hConn with no error, however upon executing dbus_bus_reguster I get gerrror = "g_error {name=0x00914a40 "org.freedesktop.DBus.Error.NoReply" message=0x00915560 "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." dummy1=0 ...} . How can I go about implementing dbus to communicate over TCP?
I have Ubuntu running and have its session.conf changed to listen on both
<listen>unix:tmpdir=/tmp</listen>
<listen>tcp:host=192.168.0.1,port=50000</listen>
#define DEFAULT_TCP_ADDR "tcp:host=192.168.0.1,port=50000"
main ()
{
g_hConn = dbus_connection_open(DEFAULT_TCP_ADDR,&g_error);
// check for valid g_hConn
ret = dbus_bus_register( g_hConn , &g_error );
// check for valid ret
ret = dbus_bus_request_name (g_hConn,g_app_name, DBUS_NAME_FLAG_REPLACE_EXISTING, &g_error );
// check for valid ret
...
}
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the dbus
mailing list