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:
cxl 2009-11-20 13:00:02 +00:00
commit 2699bad9b5
14 changed files with 743 additions and 0 deletions

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