D-Bus service shutdown on inactivity

Marriouss marriouss at gmail.com
Wed Jan 13 03:26:31 PST 2010



> 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?
>   

> Try using QDBusServiceWatcher 
> (http://doc.trolltech.com/4.6/qdbusservicewatcher.html) in 
> WatchForUnregistration mode.

That doesn't help - the watcher would be created from inside the daemon, 
the same daemon that registers/unregisters the service at 
startup/shutdown - that doesn't help in determining when there are no 
clients connected to my service.

Thanks,
Marriouss




More information about the dbus mailing list