diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-01 17:52:13 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-01 17:52:13 +0000 |
commit | f9d6817f011c1d19d887c721122d67f076199c85 (patch) | |
tree | d2bd36cd3a565b602bb82dcbda35eb5e0ee257c1 /tests | |
parent | 691e7c02bf539ce6a0656187817c2d1a577b70c4 (diff) | |
download | ATCD-f9d6817f011c1d19d887c721122d67f076199c85.tar.gz |
Added command line argument parser.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Thread_Pool_Reactor_Test.cpp | 34 |
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> |