D-Bus service shutdown on inactivity

Marriouss marriouss at gmail.com
Tue Jan 12 00:48:30 PST 2010


Date: Mon, 11 Jan 2010 14:43:58 +0100 From: Thiago Macieira 
<thiago at kde.org> Subject: Re: D-Bus service shutdown on inactivity To: 
dbus at lists.freedesktop.org Message-ID: 
<201001111443.58340.thiago at kde.org> Content-Type: text/plain; 
charset="iso-8859-1" Em Segunda-feira 11 Janeiro 2010, ?s 14:17:39, 
Marriouss escreveu:

> > Hi all,
> > 
> > I've wrote a D-bus service (registered from a daemon) and I would like
> > it to shutdown itself when no client is connected to it. How can I do
> > that? Is there a way for my service to know how many clients are
> > connected to it?
> > 
> > * I use QT D-Bus API.
> > * At this moment I shutdown the daemon on inactivity.
>   

> I don't understand the question.
>
> Why can't you shut down your app when you know that no more clients are 
> connected?
>
> Or is your problem knowing that there are no clients connected?

I want my service to free the memory when it is not used. 
Use case: 
	- daemon that creates the service is auto-launched by D-Bus when the first client connects to it
	- client finishes with the service
	- daemon should auto-close - nobody is using it

My problem: I do not know when I have clients connected to my service. I was hoping that D-Bus offers this functionality. 
If not, should I implement such an API into my service, something like: Client calls addRef when it connects and calls unref when its done?

Thanks a lot,
Marriouss



More information about the dbus mailing list