From: Schmottlach, G. <gle...@ha...> - 2009-02-26 14:02:33
|
Has anyone attempted creating a DBus server using the DBus-C++ binding? I'd like to create a service that a client can call directly and bypass the dbus-daemon. I see an (apparently) incomplete implementation of a server in server.h. I have managed to create a server that detects a new connection from the client. I then create a service inheriting from a generated adaptor but it appears my adaptor does not provide the basic interface(s) exposed by org.freedesktop.DBus. To remedy this I used dbusxx-xml2cpp to generate an org.freedesktop.DBus adaptor which my service inherited from as well, e.g. class SimpleServiceImpl : public com::SimpleService_adaptor, public org::freedesktop::DBus_adaptor, public DBus::IntrospectableAdaptor, public DBus::ObjectAdaptor { ... } The SimpleService adaptor describes the services I'm trying to implement while the DBus_adaptor contains those methods that must be implemented to support the "stock" DBus server interface. I provided a generic implementation of the DBus server methods. When I run the client I keep getting an exception that the "AddMatch" method was not found although I do provide an implementation in DBus adaptor class. It's as if the methods in the DBus_adaptor have not been registered. Normally a service would register its interface with the dbus-daemon but for a local server this won't occur (because there is no daemon running to register with). Likewise, the client does not attempt to connect directly to a system/session/activation bus but instead does a direct connect to the server I have written. Has anyone been able to create a true server that listen's on a local-socket and allows a client to connect to it directly (bypassing the dbus-daemon)? It seems like I'm close to my goal but it appears the dbusxx-xml2cpp generator creates a proxy used by the client that "assumes" it will be talking to the daemon rather than a direct connection to a server. How do I make my server appear to be a daemon? Any suggestions would be helpful . . . |