Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tests / MT_BiDir / Server_Task.cpp
blob48b6835359c873652153c498bad6cee951727be8
2 #include "Server_Task.h"
3 #include "Sender_i.h"
4 #include "tao/ORB_Core.h"
5 #include "tao/Thread_Lane_Resources.h"
6 #include "tao/Transport_Cache_Manager.h"
7 #include "ace/Manual_Event.h"
9 Server_Task::Server_Task (Sender_i *sender,
10 ACE_Manual_Event &event,
11 int no_iterations,
12 CORBA::ORB_ptr orb,
13 ACE_Thread_Manager *thr_mgr)
14 : ACE_Task_Base (thr_mgr)
15 , sender_ (sender)
16 , event_ (event)
17 , no_iterations_ (no_iterations)
18 , orb_ (CORBA::ORB::_duplicate (orb))
22 int
23 Server_Task::svc ()
25 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Wait for the Event\n"));
27 /// Wait on the event
28 /// Yes, wait on event twice. One for making sure that we have got
29 /// all the clients come and register with us.
30 this->event_.wait ();
33 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Start doing some work....\n"));
36 try
38 // Before start
39 CORBA::ULong connection_no =
40 this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size ();
42 for (int i = 0; i != this->no_iterations_; ++i)
44 if (i%50 == 0)
45 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Sending message ....\n"));
47 this->sender_->send_message ();
49 // Sanity check for connections..
50 if (connection_no <
51 this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size ())
53 // Get the latest and the greatest..
54 connection_no =
55 this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size ();
56 ACE_ERROR ((LM_DEBUG,
57 "(%P|%t) ERROR: New connections have been created\n"));
58 ACE_ERROR ((LM_DEBUG,
59 "(%P|%t) ERROR: We will crash now...\n"));
60 ACE_OS::abort ();
65 catch (const CORBA::Exception& ex)
67 ex._tao_print_exception ("Caught exception in iteration.\n");
70 return 0;