2 #include "Server_Task.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
,
13 ACE_Thread_Manager
*thr_mgr
)
14 : ACE_Task_Base (thr_mgr
)
17 , no_iterations_ (no_iterations
)
18 , orb_ (CORBA::ORB::_duplicate (orb
))
23 Server_Task::svc (void)
25 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Wait for the Event\n"));
28 /// Yes, wait on event twice. One for making sure that we have got
29 /// all the clients come and register with us.
34 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Start doing some work....\n"));
40 CORBA::ULong connection_no
=
41 this->orb_
->orb_core ()->lane_resources ().transport_cache ().current_size ();
43 for (int i
= 0; i
!= this->no_iterations_
; ++i
)
46 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Sending message ....\n"));
48 this->sender_
->send_message ();
50 // Sanity check for connections..
52 this->orb_
->orb_core ()->lane_resources ().transport_cache ().current_size ())
54 // Get the latest and the greatest..
56 this->orb_
->orb_core ()->lane_resources ().transport_cache ().current_size ();
58 "(%P|%t) ERROR: New connections have been created\n"));
60 "(%P|%t) ERROR: We will crash now...\n"));
66 catch (const CORBA::Exception
& ex
)
68 ex
._tao_print_exception ("Caught exception in iteration.\n");