summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/proto/test_proto.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/proto/test_proto.cc')
-rw-r--r--2005/i/robert/src/proto/test_proto.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/2005/i/robert/src/proto/test_proto.cc b/2005/i/robert/src/proto/test_proto.cc
index faec030..9ec119d 100644
--- a/2005/i/robert/src/proto/test_proto.cc
+++ b/2005/i/robert/src/proto/test_proto.cc
@@ -27,18 +27,13 @@
#include <iostream>
#include <stdexcept>
-#include <algorithm>
-#include <iterator>
/// Classe de test pour proto.
class TestProto : public Proto::Receiver
{
void receive (char command, const Proto::Frame &frame)
{
- std::cout << command << ' ';
- std::copy (frame.args.begin (), frame.args.end (),
- std::ostream_iterator<int> (std::cout, " "));
- std::cout << std::endl;
+ std::cout << "received " << frame << std::endl;
}
};
@@ -91,6 +86,8 @@ main (int argc, char **argv)
arg[a] = atoi (argv[++i]);
proto.send (c, format, arg[0], arg[1], arg[2], arg[3],
reliable);
+ while (!proto.wait (-1))
+ ;
}
break;
case 'w':
@@ -102,7 +99,6 @@ main (int argc, char **argv)
t = Timer::getProgramTime ();
while (t < stop)
{
- std::cout << std::endl;
proto.wait (stop - t);
t = Timer::getProgramTime ();
}