C API tutorial
Havoc Pennington
hp at redhat.com
Tue Nov 1 19:06:07 PST 2005
On Tue, 2005-11-01 at 20:37 +0000, Matthew Johnson wrote:
> > The dbus_bus_get() bus is a shared connection within the process, so
> > normally you would not close this connection. You do want to unref() the
> > connection when you're done though.
>
> will that close it when the ref count reaches 0? I was intending for
> this whole thing to be called once within the application, so all the
> setup would happen at the start, the DBusConnection reference would be
> passed around during execution and connection_close() called when the
> application quits.
The shared connection never closes (which of its users would close it?
there's no way to know when it's OK to close)
Here is some rambling about that:
http://lists.freedesktop.org/pipermail/dbus/2005-September/003360.html
There may be some issues here we should fix 1.0, should dbus_bus_get()
return a reference for example? It may have to for thread sanity I
suppose.
For what you're doing dbus_bus_get_private() is probably right, though
if you don't use any libraries the global bus is effectively private
too.
> > For interface names, the convention is foo.bar.CapitalLetters
> >
> > and for signal/method names just CapitalLetters.
> >
> > Half-tempted to enforce that in the code ;-)
>
> Only if you DOCUMENT IT (-: This is all getting a bit Java-like. I'll
> change the ones in the tutorial and my App.
Haha ;-) CapitalLetters is meant to be Windows-style really, and the
org.foo.Bar is Java-style. It's a compromise!
Havoc
More information about the dbus
mailing list