[PATCH] Add DBusServer wrapper for dbus-python

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jul 3 04:27:25 PDT 2008

Hash: SHA1

On Thu, 03 Jul 2008 at 09:47:56 +0800, Huang Peng wrote:
> After investigating the dbus_server_* APIs, I think the DBusServer is
> just like a listen socket. It listens on a socket, and create a new
> connection object, when a client connects to it. And developers can use
> the new created connection object as they want (could use it with both
> high-level or low-level API). Like, call dbus_connection_add_filter on
> it to filter incoming messages, register dbus.service.Object with this
> connection for handler messages or  use it send customized message to
> client. (but some low-level API of DBusConnection is unsupported. like:
> dbus_connection_{dispatch, pop_message, ...})

Right, I agree with you there: DBusServer should be a factory for
dbus.connection.Connection instances (or possibly subclass instances).

I was mainly responding to J5's suggestion somewhere (on the bug you filed?)
that DBusServer should be made to look like d.s.Object, which I do disagree

Yes, some of the Connection API is unsupported; I think supporting
both dispatch/pop_message, and using a "proper" main loop, will just
lead to confusion.

> I implemented server.set_new_connection_function (callback,
> UserDefinedConnectionSubClass). When a new client connects to the
> server, Server will create a new instance
> of UserDefinedConnectionSubClass, and pass it to callback function. Is
> it like your idea?

Yeah, that sounds good in principle. Hopefully I can do a detailed
review of your code sometime in the next week or so.



More information about the dbus mailing list