From a92efca156332bf3bc0064d76f7bea1d36774696 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 10 Jul 2012 18:02:32 +0000 Subject: [PATCH] reference: Rpc git-svn-id: svn://ultimatepp.org/upp/trunk@5169 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- reference/Rpc/Rpc.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/reference/Rpc/Rpc.cpp b/reference/Rpc/Rpc.cpp index 1289c323c..fee07d44c 100644 --- a/reference/Rpc/Rpc.cpp +++ b/reference/Rpc/Rpc.cpp @@ -10,21 +10,29 @@ RPC_METHOD(Multiply) rpc << m * n; } +RPC_METHOD(Multiply2) +{ + int m = rpc++; + int n = rpc++; + rpc = m * n; +} + RPC_METHOD(MultiplyNamed) { int n = rpc["first"]; int m = rpc["second"]; - rpc << m * n; + rpc = m * n; } CONSOLE_APP_MAIN { -/// LogXmlRpcRequests(); +// LogXmlRpcRequests(); // SetXmlRpcServerTrace(UppLog()); // Working in "shortened" mode - without URL specified, RpcRequests are performed by methods in // the same process. - DUMP(JsonRpcRequest()("Multiply", 10, 11).Execute()); - DUMP(XmlRpcRequest()("Multiply", 10, 11).Execute()); - DUMP(JsonRpcRequestNamed()("MultiplyNamed")("first", 10)("second", 11).Execute()); + DUMP(JsonRpcRequest()("Multiply", 2, 3).Execute()); + DUMP(JsonRpcRequest()("Multiply2", 4, 5).Execute()); + DUMP(XmlRpcRequest()("Multiply2", 6, 7).Execute()); + DUMP(JsonRpcRequestNamed()("MultiplyNamed")("first", 8)("second", 9).Execute()); }