2 #include "ace/Get_Opt.h"
3 #include "tao/Object_T.h"
4 #include "orbsvcs/PortableGroup/MIOP.h"
7 #define MAX_MIOP_OCTET_SEQUENCE (ACE_MAX_DGRAM_SIZE - 272 /* MIOP_MAX_HEADER_SIZE */)
9 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
12 parse_args (int argc
, ACE_TCHAR
*argv
[])
14 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
17 while ((c
= get_opts ()) != -1)
21 ior
= get_opts
.opt_arg ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
33 // Indicates successful parsing of the command line
38 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
43 CORBA::ORB_init (argc
, argv
);
45 if (parse_args (argc
, argv
) != 0)
48 CORBA::Object_var tmp
=
49 orb
->string_to_object(ior
);
51 /* Do an unchecked narrow since there's no way to do an is_a on
52 * a multicast reference (yet...).
54 Test::McastHello_var hello
=
55 TAO::Narrow_Utils
<Test::McastHello
>::unchecked_narrow (
58 if (CORBA::is_nil (hello
.in ()))
60 ACE_ERROR_RETURN ((LM_DEBUG
,
61 "Nil Test::Hello reference <%s>\n",
66 hello
->send_forty_two (42);
68 Test::Octets
payload (MAX_MIOP_OCTET_SEQUENCE
);
69 payload
.length (MAX_MIOP_OCTET_SEQUENCE
);
71 for (CORBA::ULong j
= 0; j
!= MAX_MIOP_OCTET_SEQUENCE
; ++j
)
76 hello
->send_large_octet_array (payload
);
82 catch (const CORBA::Exception
& ex
)
84 ex
._tao_print_exception ("Exception caught:");