public string AddNumbers(int x, int y) { using (var msg = new MethodCallMessage("org.example.sample", "/example", "org.example.sample", "AddNumbers")) { var invoc = new DvInvocation(msg); invoc.Write(x); invoc.Write(y); invoc.WriteEnd(); var reply = _bus.MethodCallSync(msg, 5000); return reply?.GetArg(0)?.Value.ToString() ?? ""; } }
public void DoSomething() { using (var msg = new MethodCallMessage("org.example.sample", "/example", "org.example.sample", "DoSomething")) { var invoc = new DvInvocation(msg); invoc.WriteEnd(); _bus.MethodCall(msg, 5000); } }Package library: AllJoyn.