10 public FooStruct (int i, string s) {
16 [DBus (name = "org.example.Test")]
17 interface Test : Object {
18 public abstract FooStruct test_property { owned get; set; }
20 public abstract FooStruct test_struct (FooStruct f, out FooStruct g) throws IOError;
25 Test test = Bus.get_proxy_sync (BusType.SESSION, "org.example.Test", "/org/example/test");
28 f = FooStruct (42, "hello");
29 h = test.test_struct (f, out g);
31 assert (g.s == "world");
33 assert (h.s == "vala");
35 test.test_property = f;
36 g = test.test_property;
38 assert (g.s == "hello");
47 public FooStruct (int i, string s) {
53 [DBus (name = "org.example.Test")]
55 public FooStruct test_property { owned get; set; }
57 public FooStruct test_struct (FooStruct f, out FooStruct g) {
59 assert (f.s == "hello");
60 g = FooStruct (23, "world");
61 return FooStruct (11, "vala");
67 void client_exit (Pid pid, int status) {
68 // client finished, terminate server
74 var conn = Bus.get_sync (BusType.SESSION);
75 conn.register_object ("/org/example/test", new Test ());
77 // try to register service in session bus
78 app = new Application ("org.example.Test");
80 // server ready, spawn client
82 Process.spawn_async (null, { "test", "/dbus/structs/client" }, null, SpawnFlags.DO_NOT_REAP_CHILD, null, out client_pid);
83 ChildWatch.add (client_pid, client_exit);