mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
.reference: XmlRpc
git-svn-id: svn://ultimatepp.org/upp/trunk@4890 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9feac5022f
commit
8b258a0164
7 changed files with 118 additions and 119 deletions
|
|
@ -1,28 +1,27 @@
|
|||
#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);
|
||||
}
|
||||
#include <Core/XmlRpc/XmlRpc.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
void Compute(double a, String op, double b)
|
||||
{
|
||||
double result;
|
||||
Cout() << a << op << b << '=';
|
||||
XmlRpcRequest 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;
|
||||
XmlRpcRequest("127.0.0.1:1234")("ping") >> tm;
|
||||
Cout() << tm << '\n';
|
||||
|
||||
Compute(12, "+", 12);
|
||||
Compute(12, "*", 12);
|
||||
Compute(12, "+56", 12);
|
||||
Compute(12, "/", 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ description "Client for XmlRpcServer example\377";
|
|||
|
||||
uses
|
||||
Core,
|
||||
XmlRpc;
|
||||
Core/XmlRpc;
|
||||
|
||||
file
|
||||
XmlRpcClient.cpp;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef _XmlRpcClient_icpp_init_stub
|
||||
#define _XmlRpcClient_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "XmlRpc/init"
|
||||
#include "Core/XmlRpc/init"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue