summaryrefslogtreecommitdiff
path: root/cppe/demo/IceE/hello/Client.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-12-01 13:08:47 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-12-01 13:08:47 +0000
commite22d4121dd7af83a79e10be56301b12b8be8ecda (patch)
tree25abd23196092d3d2281ee317fc1850ea5db6073 /cppe/demo/IceE/hello/Client.cpp
parentAdded better timeout test (diff)
downloadice-e22d4121dd7af83a79e10be56301b12b8be8ecda.tar.bz2
ice-e22d4121dd7af83a79e10be56301b12b8be8ecda.tar.xz
ice-e22d4121dd7af83a79e10be56301b12b8be8ecda.zip
Added test for timeout
Diffstat (limited to 'cppe/demo/IceE/hello/Client.cpp')
-rw-r--r--cppe/demo/IceE/hello/Client.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/cppe/demo/IceE/hello/Client.cpp b/cppe/demo/IceE/hello/Client.cpp
index ff5f5a44896..0c33acc7e12 100644
--- a/cppe/demo/IceE/hello/Client.cpp
+++ b/cppe/demo/IceE/hello/Client.cpp
@@ -24,6 +24,7 @@ menu()
printf("f: flush all batch requests\n");
#endif
printf("T: set a timeout\n");
+ printf("P: set a server delay\n");
printf("s: shutdown server\n");
printf("x: exit\n");
printf("?: help\n");
@@ -54,6 +55,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
#endif
int timeout = -1;
+ int delay = 0;
menu();
@@ -70,16 +72,16 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
while(c != EOF && c == '\n');
if(c == 't')
{
- twoway->sayHello();
+ twoway->sayHello(delay);
}
else if(c == 'o')
{
- oneway->sayHello();
+ oneway->sayHello(delay);
}
#ifdef ICEE_HAS_BATCH
else if(c == 'O')
{
- batchOneway->sayHello();
+ batchOneway->sayHello(delay);
}
else if(c == 'f')
{
@@ -111,6 +113,26 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
printf("timeout is now set to 2000ms\n");
}
}
+ else if(c == 'P')
+ {
+ if(delay == 0)
+ {
+ delay = 2500;
+ }
+ else
+ {
+ delay = 0;
+ }
+
+ if(delay == 0)
+ {
+ printf("server delay is now deactivated\n");
+ }
+ else
+ {
+ printf("server delay is now set to 2500ms\n");
+ }
+ }
else if(c == 's')
{
twoway->shutdown();