Basic understanding servers / clients objects/proxies

David Belser thebelserturner at gmail.com
Wed Dec 12 10:49:43 PST 2007


I'm delving deeper into DBus, in particular the C API. I want to confirm my
basic understanding of how the API works.

When writing a server, an object is registered with
dbus_connection_register_object_path. The DBus libaray will then use the
vtable to call my handler function for ANY message recieved by my service
that specifies the object path I used in the registration call.

It is up to my handler to determine if my registered object supports the
method in the message.

When using a proxy for a remote object where I want to receive signals  from
the remote object, I would first dbus_connection_add_filter, followed by
dbus_bus_add_match with rules for each signal that I'm interested in.

The bus daemon will send any signals that match and my filter routine will
check the messages and act on the signals. Any messages sent to my service
will be passed to my filter routine.

So, if I have an app that both exports objects and also uses remote objects:

Method calls on my exported objects will pass through my filter routine
(which should ignore them) and then get passed to my object handler (
_vtable handler function ) for my object to handle. Signals that I have
added match rules will also pass to my filter function which will then act
upon them.

What I'm trying to understand is the correct way to handle inbound (async?)
messages in an application that both exports objects and uses remote
objects.

The third type of inbound messages would be replies to calls on remote
objects, is it correct to also handle these in my filter function, or
additional filter functions on a per-proxy object? I presume that I don't
need to add a match rule to receive the replies to remote calls as they
should be addressed to me as the destination.

Thanks in advance for the enlightenment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20071212/79378197/attachment.htm 


More information about the dbus mailing list