mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-25 22:03:45 -06:00
Reference: Added Mt Rpc Client/Server
git-svn-id: svn://ultimatepp.org/upp/trunk@5556 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2087db62fb
commit
a9b5a6d19c
6 changed files with 195 additions and 0 deletions
34
reference/MtRpcClient/MtRpcClient.cpp
Normal file
34
reference/MtRpcClient/MtRpcClient.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <Core/Core.h>
|
||||
#include <Core/Rpc/Rpc.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
void GetClientList(int i)
|
||||
{
|
||||
INTERLOCKED { LOG("=>> GetClientList(" << i << ")"); }
|
||||
|
||||
ValueArray result;
|
||||
XmlRpcRequest call("127.0.0.1:1234");
|
||||
|
||||
if(call("GetClientList") >> result)
|
||||
{
|
||||
INTERLOCKED { LOG("Message received " << i); }
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERLOCKED { LOG("Error: " << call.GetError()); }
|
||||
}
|
||||
|
||||
INTERLOCKED { LOG("<<= GetClientList(" << i << ")"); }
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
CoWork co;
|
||||
for(int i = 0; i < 20; i++)
|
||||
{
|
||||
co & callback1(GetClientList, i);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue