Re: [Vala] Register object in SYSTEM bus
- From: Matthias Klumpp <matthias tenstral net>
- To: rastersoft <raster rastersoft com>
- Cc: Vala Mail List <vala-list gnome org>
- Subject: Re: [Vala] Register object in SYSTEM bus
- Date: Wed, 7 Nov 2012 23:51:06 +0100
Hi!
Have you created a DBus interface file? Are you running that stuff as root?
Cheers,
Matthias
2012/11/7 rastersoft <raster rastersoft com>:
Hi all:
I'm trying to register an object in dbus'SYSTEM bus, but I'm unable to
do so. I try with:
[DBus (name = "com.rastersoft.gamed")]
public class dbus_class: Object {
public void set_priority(int new_priority) {
k.do_check(new_priority);
}
}
void on_bus_aquired (DBusConnection conn) {
GLib.stdout.printf ("Registering bus\n");
try {
var l=conn.register_object<dbus_class> ("/com/rastersoft/gamed", new dbus_class());
GLib.stdout.printf ("Registered bus %d\n",(int)l);
} catch (IOError e) {
GLib.stderr.printf ("Could not register service\n");
Posix.exit(-1);
}
}
Bus.own_name (BusType.SYSTEM, "com.rastersoft.gamed", BusNameOwnerFlags.NONE, on_bus_aquired , () => {
GLib.stdout.printf ("Catched bus\n");
}, () => {
GLib.stderr.printf ("Bus lost\n");
Posix.exit(-1);
});
But always get "Bus lost". If I replace BusType.SYSTEM with
BusType.SESSION, it works fine. What am I doing incorrect?
Thanks!
--
Nos leemos
RASTER (Linux user #228804)
raster rastersoft com http://www.rastersoft.com
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]