summaryrefslogtreecommitdiff
path: root/tests/Thread_Pool_Reactor_Test.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-01 17:52:13 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-01 17:52:13 +0000
commit68db421ab2c4274c6b8d425192c41bc7cd8066f6 (patch)
treed2bd36cd3a565b602bb82dcbda35eb5e0ee257c1 /tests/Thread_Pool_Reactor_Test.cpp
parent3a7031107d6a25783b63559a056351ef7710851c (diff)
downloadATCD-68db421ab2c4274c6b8d425192c41bc7cd8066f6.tar.gz
Added command line argument parser.
Diffstat (limited to 'tests/Thread_Pool_Reactor_Test.cpp')
-rw-r--r--tests/Thread_Pool_Reactor_Test.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp
index c5a82e48164..d842d18e27a 100644
--- a/tests/Thread_Pool_Reactor_Test.cpp
+++ b/tests/Thread_Pool_Reactor_Test.cpp
@@ -39,6 +39,7 @@
// ============================================================================
#include "tests/test_config.h"
+#include "ace/Get_Opt.h"
#include "ace/SOCK_Connector.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/Acceptor.h"
@@ -67,9 +68,38 @@ void
parse_arg (int argc, ASYS_TCHAR *argv[])
{
// @@ TODO: Support command line arguments stated above.
+ ACE_Get_Opt getopt (argc, argv, ASYS_TEXT ("r:s:c:d:i:n:"));
- ACE_UNUSED_ARG (argc);
- ACE_UNUSED_ARG (argv);
+ int c;
+
+ while ((c = getopt ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r': // hostname:port
+ rendezvous = getopt.optarg;
+ break;
+ case 's':
+ svr_thrno = ACE_OS::atoi (getopt.optarg);
+ break;
+ case 'c':
+ cli_thrno = ACE_OS::atoi (getopt.optarg);
+ break;
+ case 'd':
+ req_delay = ACE_OS::atoi (getopt.optarg);
+ break;
+ case 'i':
+ cli_conn_no = ACE_OS::atoi (getopt.optarg);
+ break;
+ case 'n':
+ cli_req_no = ACE_OS::atoi (getopt.optarg);
+ break;
+ default:
+ ACE_ERROR ((LM_ERROR,
+ ASYS_TEXT ("Invalid command line argument: %c\n"), c));
+ break;
+ }
+ }
}
class Acceptor_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH>