2 #include "ace/Get_Opt.h"
3 #include "ace/OS_NS_stdio.h"
4 #include "ace/Argv_Type_Converter.h"
5 #include "tao/IORTable/IORTable.h"
6 #include "Server_Task.h"
8 const ACE_TCHAR
*ior_output_file
= ACE_TEXT("server.ior");
11 parse_args (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("o:"));
16 while ((c
= get_opts ()) != -1)
20 ior_output_file
= get_opts
.opt_arg ();
25 ACE_ERROR_RETURN ((LM_ERROR
,
32 // Indicates successful parsing of the command line
37 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
41 ACE_Argv_Type_Converter
satc (argc
, argv
);
43 CORBA::ORB_init (satc
.get_argc (),
44 satc
.get_TCHAR_argv ());
46 if (parse_args (argc
, argv
) != 0)
51 Server_Task
server_task (ior_output_file
,
54 ACE_Thread_Manager::instance ());
56 if (server_task
.activate (THR_NEW_LWP
| THR_JOINABLE
,
60 ACE_ERROR ((LM_ERROR
, "Error activating server task\n"));
63 // Wait for the server thread to do some processing
66 ACE_Thread_Manager::instance ()->wait ();
71 catch (const CORBA::Exception
& ex
)
73 ex
._tao_print_exception ("Exception caught:");