summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp')
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp67
1 files changed, 17 insertions, 50 deletions
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
index 5441a632e0e..34b30ae6448 100644
--- a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
@@ -38,8 +38,7 @@ run_orb_within_thread (void *)
ACE_TRY
{
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
@@ -48,7 +47,6 @@ run_orb_within_thread (void *)
// them results in a spin loop.
ACE_Time_Value tv (0, 50000);
orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
}
}
ACE_CATCHANY
@@ -59,7 +57,6 @@ run_orb_within_thread (void *)
return 0;
}
ACE_ENDTRY;
- ACE_CHECK_RETURN (0);
}
return 0;
@@ -84,7 +81,6 @@ main (int argc, char* argv[])
// Create the ORB, pass the argv list for parsing.
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
@@ -102,15 +98,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 COMPLETES THE ORB SETUP
@@ -132,15 +124,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
@@ -176,8 +166,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:
@@ -200,7 +189,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"
@@ -215,7 +203,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;
// To receive events we need to setup an event handler:
TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver;
@@ -235,7 +222,6 @@ main (int argc, char* argv[])
// events:
mcast_eh.open (event_channel.in ()
ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
// Again the receiver connects to the event channel as a
// supplier of events, using the Observer features to detect
@@ -244,7 +230,6 @@ main (int argc, char* argv[])
endpoint,
address_server.in ()
ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
// The Receiver is also a supplier of events. The exact type of
// events is only known to the application, because it depends
@@ -264,7 +249,6 @@ main (int argc, char* argv[])
pub.is_gateway = 1;
receiver->connect (pub ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
// **************** THAT COMPLETES THE FEDERATION SETUP
@@ -275,21 +259,16 @@ main (int argc, char* argv[])
Consumer consumer1;
Consumer consumer2;
RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
- event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ event_channel->for_consumers ();
consumer1.connect (consumer_admin.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
consumer2.connect (consumer_admin.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
// And now create a supplier
Supplier supplier;
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
@@ -307,8 +286,7 @@ main (int argc, char* argv[])
for (int i = 0; i < data_items; i++)
{
- supplier.perform_push (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ supplier.perform_push ();
}
ACE_OS::sleep (2); // simple solution ensures ready receivers
@@ -323,16 +301,12 @@ main (int argc, char* argv[])
// **************** HERE IS THE CLEANUP CODE
// First the easy ones
- supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- consumer1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- consumer2.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ supplier.disconnect ();
+ consumer1.disconnect ();
+ consumer2.disconnect ();
// Now let us disconnect the Receiver
- receiver->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ receiver->shutdown ();
int r = mcast_eh.shutdown ();
@@ -343,14 +317,12 @@ main (int argc, char* argv[])
}
// And also disconnect 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:
@@ -361,25 +333,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