[DBus (name = "org.example.Demo")] public class DemoServer : Object { public signal void Lctest(string ff); private string _TestProp = "startval"; public signal void TestSign(string ff); public string TestProp { owned get{ return _TestProp; } set{ _TestProp = value; } } private int counter; public int ping (string msg) { stdout.printf ("%s\n", msg); return counter++; } } void main () { try { var conn = Bus.get_sync (BusType.SESSION); int i = 0; var sv = new DemoServer (); conn.register_object ("/org/example/Demo", sv); var app = new Application ("org.example.Demo"); Timeout.add_seconds(4, () => { sv.TestProp = "fff" + i.to_string(); sv.Lctest("signal from server\n"); i++; return true; }); // sv.notify["TestProp"].connect( () => { print("notify TestProp\n"); }); app.run (); } catch (IOError e) { stderr.printf ("%s\n", e.message); } } //$ valac --pkg gio-2.0 server.vala