dbus server sans callbacks

Simon Burton simon at arrowtheory.com
Fri Mar 9 10:53:48 PST 2007


On Fri, 9 Mar 2007 10:20:40 -0800
Simon Burton <simon at arrowtheory.com> wrote:

> 
> I'm writing a dbus server, but without using the callback mechanism.
> (The app has it's own select loop).
> 
> So, I'm thinking I can create a DBusServer and extract its fd for the select loop,
> or do my own listen and build a DBusConnection from a fd.

OK, looks like I will follow this outline to get a DBusConnection:

dbus-server-socket.c

handle_new_client_fd_and_unlock (DBusServer *server,
                                 int         client_fd)

	transport = _dbus_transport_new_for_socket (client_fd, &server->guid_hex, NULL);
	if (transport == NULL)
		...
	if (!_dbus_transport_set_auth_mechanisms (transport,
                                            (const char **) server->auth_mechanisms))
		...
	connection = _dbus_connection_new_for_transport (transport);
	_dbus_transport_unref (transport);

	transport = NULL; /* now under the connection lock */


Simon.


More information about the dbus mailing list