3 #ifndef MESSENGERSERVER_H_
4 #define MESSENGERSERVER_H_
6 #include "MessengerS.h"
10 //Class MessengerServer
15 MessengerServer (CORBA::ORB_ptr orb
);
18 virtual ~MessengerServer ();
21 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
23 // run the ORB's event loop continuously
26 // run the ORB's event loop for some number of seconds
27 void run (int seconds
);
29 // handle ORB events in a polling loop for some number of iterations
30 void poll (int iterations
);
32 // schedule a shutdown timer with the ORB's reactor to timeout
34 void schedule_shutdown_timer (int seconds
);
36 // spawn thread to monitor console and shutdown on console input
37 void shutdown_on_console_input ();
40 s_client_call
, // shutdown on client invocation
41 s_polling_loop
, // shutdown after some iterations through loop
42 s_timer
, // schedule a timer to shutdown
43 s_console_input
, // shutdown on console input
44 s_run_time_value
// use CORBA::ORB::run() with time value
47 // Task to monitor console input.
48 class ConsoleMonitor
: public ACE_Task_Base
51 ConsoleMonitor (CORBA::ORB_ptr orb
)
52 : orb_(CORBA::ORB::_duplicate(orb
))
60 orb_
->shutdown (true);
69 ConsoleMonitor
* monitor_
;
72 #endif /* MESSENGERSERVER_H_ */