mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.reference: Rpc
git-svn-id: svn://ultimatepp.org/upp/trunk@5355 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
360a51663e
commit
295f172c86
1 changed files with 8 additions and 0 deletions
|
|
@ -33,11 +33,18 @@ RPC_METHOD(MultiplyNamed)
|
|||
rpc = m * n;
|
||||
}
|
||||
|
||||
RPC_METHOD(JsonMultiply)
|
||||
{
|
||||
Value v = rpc++;
|
||||
rpc = Json("result", (int)v["first"] * (int)v["second"]);
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
// LogXmlRpcRequests();
|
||||
// SetXmlRpcServerTrace(UppLog());
|
||||
|
||||
// Working in "shortened" mode - without URL specified, RpcRequests are performed by methods in
|
||||
// the same process.
|
||||
|
||||
|
|
@ -47,4 +54,5 @@ CONSOLE_APP_MAIN
|
|||
DUMP(JsonRpcRequestNamed()("MultiplyNamed")("first", 8)("second", 9).Execute());
|
||||
DUMP(JsonRpcRequest()("Divide", 2, 0).Execute());
|
||||
DUMP(JsonRpcRequest()("Divide", 20, 4).Execute());
|
||||
DUMP(JsonRpcRequest()("JsonMultiply", Json("first", 4)("second", 10)).Execute());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue