summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/throughput/Client.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-02-23 22:38:22 +0000
committerMarc Laukien <marc@zeroc.com>2005-02-23 22:38:22 +0000
commitae78f93a665efe66b878016c933ccb702f83fc85 (patch)
treee4f4a8b1f29e3256d31035942c42181c0c28f6ca /cpp/demo/Ice/throughput/Client.cpp
parentmore optimizations (diff)
downloadice-ae78f93a665efe66b878016c933ccb702f83fc85.tar.bz2
ice-ae78f93a665efe66b878016c933ccb702f83fc85.tar.xz
ice-ae78f93a665efe66b878016c933ccb702f83fc85.zip
more optimizations
Diffstat (limited to 'cpp/demo/Ice/throughput/Client.cpp')
-rw-r--r--cpp/demo/Ice/throughput/Client.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/cpp/demo/Ice/throughput/Client.cpp b/cpp/demo/Ice/throughput/Client.cpp
index 8113ae724b0..11bae701e8c 100644
--- a/cpp/demo/Ice/throughput/Client.cpp
+++ b/cpp/demo/Ice/throughput/Client.cpp
@@ -18,10 +18,11 @@ menu()
{
cout <<
"usage:\n"
- "s: send byte sequence\n"
+ "t: send byte sequence as twoway\n"
"o: send byte sequence as oneway\n"
"r: receive byte sequence\n"
"e: echo (send and receive) byte sequence\n"
+ "s: shutdown server\n"
"x: exit\n"
"?: help\n";
}
@@ -51,6 +52,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
menu();
+ throughput->ice_ping(); // Initial ping to setup the connection.
+
char c;
do
{
@@ -59,16 +62,14 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
cout << "==> ";
cin >> c;
- throughput->ice_ping(); // Initial ping to setup the connection.
-
IceUtil::Time tm = IceUtil::Time::now();
const int repetitions = 1000;
- if(c == 's' || c == 'o' || c == 'r' || c == 'e')
+ if(c == 't' || c == 'o' || c == 'r' || c == 'e')
{
switch(c)
{
- case 's':
+ case 't':
case 'o':
{
cout << "sending";
@@ -101,7 +102,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
switch(c)
{
- case 's':
+ case 't':
{
throughput->sendByteSeq(seq);
break;
@@ -137,6 +138,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
cout << "throughput: " << mbit << " MBit/s" << endl;
}
+ else if(c == 's')
+ {
+ throughput->shutdown();
+ }
else if(c == 'x')
{
// Nothing to do