mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-31 07:12:39 -06:00
reference: Rpc
git-svn-id: svn://ultimatepp.org/upp/trunk@5169 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1dbfde1189
commit
a92efca156
1 changed files with 13 additions and 5 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue