mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
28 lines
536 B
C++
28 lines
536 B
C++
#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);
|
|
}
|