ultimatepp/bazaar/UrrPingClient/main.cpp
cxl 2699bad9b5 bazaar: Added Urr - UDP request-response
git-svn-id: svn://ultimatepp.org/upp/trunk@1710 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-11-20 13:00:02 +00:00

21 lines
467 B
C++

#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);
}
}