mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
bazaar: Added Urr - UDP request-response
git-svn-id: svn://ultimatepp.org/upp/trunk@1710 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
23bfa4d036
commit
2699bad9b5
14 changed files with 743 additions and 0 deletions
21
bazaar/UrrPingClient/main.cpp
Normal file
21
bazaar/UrrPingClient/main.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include <Urr/Urr.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
UrrClient urr;
|
||||
urr.SetServer(CommandLine().GetCount() ? CommandLine()[0] : "127.0.0.1", 7593);
|
||||
for(;;) {
|
||||
int tm = GetTickCount();
|
||||
String r = AsString(rand());
|
||||
Cout() << "request: " << r;
|
||||
r = urr.Call(r);
|
||||
int tm2 = GetTickCount();
|
||||
if(r.GetCount())
|
||||
Cout() << ", response " << r << " in " << tm2 - tm << "ms\n";
|
||||
else
|
||||
Cout() << ", TIMEOUT!\n";
|
||||
Sleep(1000);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue