diff options
Diffstat (limited to 'TAO/examples/POA/Generic_Servant/client.cpp')
-rw-r--r-- | TAO/examples/POA/Generic_Servant/client.cpp | 57 |
1 files changed, 19 insertions, 38 deletions
diff --git a/TAO/examples/POA/Generic_Servant/client.cpp b/TAO/examples/POA/Generic_Servant/client.cpp index d1f9c2296a5..a3b4280154f 100644 --- a/TAO/examples/POA/Generic_Servant/client.cpp +++ b/TAO/examples/POA/Generic_Servant/client.cpp @@ -28,13 +28,11 @@ static char *IOR_file = 0; static int iterations = 1; static int oneway = 0; static int shutdown_server = 0; -static CORBA::ULong timeout = 5; -static int timed_operations = 0; static int parse_args (int argc, char **argv) { - ACE_Get_Opt get_opts (argc, argv, "f:k:i:T:otx"); + ACE_Get_Opt get_opts (argc, argv, "f:k:i:ox"); int c; while ((c = get_opts ()) != -1) @@ -52,18 +50,10 @@ parse_args (int argc, char **argv) oneway = 1; break; - case 't': - timed_operations = 1; - break; - case 'i': iterations = ::atoi (get_opts.optarg); break; - case 'T': - timeout = ACE_static_cast (CORBA::ULong, ::atoi (get_opts.optarg)); - break; - case 'x': shutdown_server = 1; break; @@ -75,8 +65,6 @@ parse_args (int argc, char **argv) "-k IOR " "-f IOR file " "-o oneway " - "-t timed operations " - "-T timeout for timed operations " "\n", argv [0]), -1); @@ -159,17 +147,17 @@ main (int argc, char **argv) ACE_TRY { // Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv, - 0, + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + 0, ACE_TRY_ENV); ACE_TRY_CHECK; - + // Initialize options based on command-line arguments. int parse_args_result = parse_args (argc, argv); if (parse_args_result != 0) return parse_args_result; - + if (IOR == 0) { int result = read_IOR_from_file (); @@ -178,17 +166,17 @@ main (int argc, char **argv) } // Get an object reference from the argument string. - CORBA::Object_var object = orb->string_to_object (IOR, + CORBA::Object_var object = orb->string_to_object (IOR, ACE_TRY_ENV); ACE_TRY_CHECK; // Try to narrow the object reference to a Foo reference. - Foo_var foo = Foo::_narrow (object.in (), + Foo_var foo = Foo::_narrow (object.in (), ACE_TRY_ENV); ACE_TRY_CHECK; - + CORBA::String_var ior = - orb->object_to_string (foo.in (), + orb->object_to_string (foo.in (), ACE_TRY_ENV); ACE_TRY_CHECK; @@ -196,16 +184,16 @@ main (int argc, char **argv) ACE_DEBUG ((LM_DEBUG, "\nConnecting to: %s\n\n", ior.in ())); - + ACE_Profile_Timer timer; ACE_Profile_Timer::ACE_Elapsed_Time elapsed_time; - + // We start an ACE_Profile_Timer here... timer.start (); - + CORBA::Long result = 0; int i = 0; - + for (i = 0; i < iterations; i++) { if (oneway) @@ -214,13 +202,6 @@ main (int argc, char **argv) foo->simply_doit (ACE_TRY_ENV); ACE_TRY_CHECK; } - else if (timed_operations) - { - // Invoke the timed_operation() method of the foo reference. - foo->timed_operation (timeout, - ACE_TRY_ENV); - ACE_TRY_CHECK; - } else { // Invoke the doit() method of the foo reference. @@ -232,10 +213,10 @@ main (int argc, char **argv) // stop the timer. timer.stop (); timer.elapsed_time (elapsed_time); - + // compute average time. print_stats (elapsed_time, i); - + if (shutdown_server) { foo->shutdown (ACE_TRY_ENV); @@ -244,9 +225,9 @@ main (int argc, char **argv) // Print the result of doit () method of the foo reference. ACE_DEBUG ((LM_DEBUG, "The result of doit is %d\n", result)); - + ACE_TIMEPROBE_PRINT; - + ACE_OS::free (IOR); } ACE_CATCHANY @@ -254,7 +235,7 @@ main (int argc, char **argv) ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Error!"); return -1; } - ACE_ENDTRY; + ACE_ENDTRY; ACE_CHECK_RETURN (-1); return 0; |