2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
7 parse_args (int argc
, ACE_TCHAR
*argv
[])
9 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
12 while ((c
= get_opts ()) != -1)
16 ior
= get_opts
.opt_arg ();
21 ACE_ERROR_RETURN ((LM_ERROR
,
28 // Indicates successful parsing of the command line
33 int ACE_TMAIN (int argc
, ACE_TCHAR
* argv
[])
38 CORBA::ORB_init (argc
, argv
);
40 if (parse_args (argc
, argv
) != 0)
43 CORBA::Object_var tmp
=
44 orb
->string_to_object (ior
);
46 BlobServer_var blobServer
= BlobServer::_narrow(tmp
.in());
47 if(CORBA::is_nil(blobServer
.in()))
49 ACE_ERROR_RETURN ((LM_DEBUG
,
50 "Nil Test::Hello reference <%s>\n",
55 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) client - test\n"));
60 for(CORBA::ULong i
= 0; i
< blob1
.length(); i
++)
67 blobServer
->test(blob1
, blob2
);
69 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) client - checking reply for ABCDEFGHIJ\n"));
71 for(CORBA::ULong i
= 0; i
< blob1
.length(); i
++)
73 if (blob1
[i
] != static_cast <CORBA::Octet
> ('A' + i
))
76 "Error invalid value detected on position <%d> in blob1\n",
81 for(CORBA::ULong i
= 0; i
< blob2
.length(); i
++)
83 if (blob2
[i
] != static_cast <CORBA::Octet
> ('A' + i
))
86 "Error invalid value detected on position <%d> in blob2\n",
91 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) client - shutdown\n"));
93 blobServer
->shutdown ();
97 catch (const CORBA::Exception
& ex
)
99 ex
._tao_print_exception ("Exception caught:");