diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Event/UDP/sender.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/Event/UDP/sender.cpp | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/TAO/orbsvcs/tests/Event/UDP/sender.cpp b/TAO/orbsvcs/tests/Event/UDP/sender.cpp index 07d00c02a6a..2de064826ac 100644 --- a/TAO/orbsvcs/tests/Event/UDP/sender.cpp +++ b/TAO/orbsvcs/tests/Event/UDP/sender.cpp @@ -49,7 +49,6 @@ main (int argc, char* argv[]) // Create the ORB, pass the argv list for parsing. CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Parse the arguments, you usually want to do this after // invoking ORB_init() because ORB_init() will remove all the @@ -67,15 +66,11 @@ main (int argc, char* argv[]) // it will not process any requests. CORBA::Object_var object = orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POA_var poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POAManager_var poa_manager = - poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa->the_POAManager (); + poa_manager->activate (); // **************** THAT COMPLETS THE ORB SETUP @@ -97,15 +92,13 @@ main (int argc, char* argv[]) // that may involve creating some threads. // But it should always be invoked because several internal data // structures are initialized at that point. - ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + ec_impl.activate (); // The event channel is activated as any other CORBA servant. // In this case we use the simple implicit activation with the // RootPOA RtecEventChannelAdmin::EventChannel_var event_channel = - ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + ec_impl._this (); // **************** THAT COMPLETES THE LOCAL EVENT CHANNEL SETUP @@ -141,8 +134,7 @@ main (int argc, char* argv[]) // Now we create and activate the servant AddrServer as_impl (addr); RtecUDPAdmin::AddrServer_var address_server = - as_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + as_impl._this (); // We need a local socket to send the data, open it and check // that everything is OK: @@ -159,7 +151,6 @@ main (int argc, char* argv[]) address_server.in (), endpoint ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Now we connect the sender as a consumer of events, it will // receive any event from any source and send it to the "right" @@ -174,7 +165,6 @@ main (int argc, char* argv[]) ACE_ES_EVENT_SOURCE_ANY; // Any source is OK sender->connect (sub ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // **************** THAT COMPLETES THE FEDERATION SETUP @@ -183,11 +173,9 @@ main (int argc, char* argv[]) // And now create a supplier Supplier supplier (valuetype); RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = - event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + event_channel->for_suppliers (); supplier.connect (supplier_admin.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // **************** THAT COMPLETES THE CLIENT SETUP @@ -199,8 +187,7 @@ main (int argc, char* argv[]) for (int i = 0; i != 25; ++i) { CORBA::Boolean there_is_work = - orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->work_pending (); if (there_is_work) { // We use a TAO extension. The CORBA mechanism does not @@ -209,12 +196,10 @@ main (int argc, char* argv[]) // them results in a spin loop. ACE_Time_Value tv (0, 50000); orb->perform_work (tv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } ACE_Time_Value tv (0, 100000); ACE_OS::sleep (tv); - supplier.perform_push (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + supplier.perform_push (); } // **************** THAT COMPLETES THE EVENT LOOP @@ -222,18 +207,15 @@ main (int argc, char* argv[]) // **************** HERE STARTS THE CLEANUP CODE // First the easy ones - supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + supplier.disconnect (); // And also close the sender of events - sender->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sender->shutdown (); // The event channel must be destroyed, so it can release its // resources, and inform all the clients that are still // connected that it is going away. - event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + event_channel->destroy (); // Deactivating the event channel implementation is not strictly // required, the POA will do it for us, but it is good manners: @@ -244,25 +226,20 @@ main (int argc, char* argv[]) // is the root POA, but the code is more robust if we don't // rely on that. PortableServer::POA_var poa = - ec_impl._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + ec_impl._default_POA (); // Get the Object Id used for the servant.. PortableServer::ObjectId_var oid = poa->servant_to_id (&ec_impl ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Deactivate the object poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } // Now we can destroy the POA, the flags mean that we want to // wait until the POA is really destroyed poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Finally destroy the ORB - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->destroy (); // **************** THAT COMPLETES THE CLEANUP CODE |