Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / Bug_689_Regression / client.cpp
blob06498e58b33a033af82e174fb689f2cad2bb40ec
1 #include "bug_689_regressionC.h"
2 #include "ace/Get_Opt.h"
3 #include "ace/OS_NS_unistd.h"
4 #include "ace/Argv_Type_Converter.h"
6 const ACE_TCHAR *ior = ACE_TEXT ("file://server.ior");
8 int
9 parse_args (int argc, ACE_TCHAR *argv[])
11 ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("k:"));
12 int c;
14 while ((c = get_opts ()) != -1)
15 switch (c)
17 case 'k':
18 ior = get_opts.opt_arg ();
19 break;
21 case '?':
22 default:
23 ACE_ERROR_RETURN ((LM_ERROR,
24 "usage: %s "
25 "-k <ior> "
26 "\n",
27 argv [0]),
28 -1);
30 // Indicates successful parsing of the command line
31 return 0;
34 int
35 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
37 try
39 ACE_Argv_Type_Converter argcon (argc, argv);
40 CORBA::ORB_var orb = CORBA::ORB_init (argcon.get_argc (),
41 argcon.get_TCHAR_argv ());
43 if (parse_args (argc, argv) != 0)
44 return 1;
46 CORBA::Object_var tmp = orb->string_to_object (ior);
48 bug_689_regression_var servant = bug_689_regression::_narrow(tmp.in ());
50 if (CORBA::is_nil (servant.in ()))
52 ACE_ERROR_RETURN ((LM_DEBUG,
53 "Nil bug_689_regression reference <%s>\n",
54 ior),
55 1);
58 servant->noop ();
59 servant->shutdown ();
61 ACE_Time_Value tv (0, 500);
62 ACE_OS::sleep (tv);
64 orb->destroy ();
66 catch (const CORBA::Exception& ex)
68 ex._tao_print_exception ("Exception caught:");
69 return 1;
72 return 0;