mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-28 06:12:37 -06:00
reference: XmlRpcCall, XmlRpcSever, XmlRpcClient
git-svn-id: svn://ultimatepp.org/upp/trunk@1822 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6dbea1df2e
commit
bf3f4990bb
10 changed files with 167 additions and 0 deletions
28
reference/XmlRpcClient/XmlRpcClient.cpp
Normal file
28
reference/XmlRpcClient/XmlRpcClient.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <XmlRpc/XmlRpc.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
|
||||
void Compute(double a, String op, double b)
|
||||
{
|
||||
double result;
|
||||
Cout() << a << op << b << '=';
|
||||
XmlRpcCall call("127.0.0.1:1234");
|
||||
if(call("compute", a, op, b) >> result)
|
||||
Cout() << result;
|
||||
else
|
||||
Cout() << " error: " << call.GetError();
|
||||
Cout() << '\n';
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
Time tm;
|
||||
XmlRpcCall("127.0.0.1:1234")("ping") >> tm;
|
||||
Cout() << tm << '\n';
|
||||
|
||||
Compute(12, "+", 12);
|
||||
Compute(12, "*", 12);
|
||||
Compute(12, "+56", 12);
|
||||
Compute(12, "/", 0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue