2 #include "ace/Get_Opt.h"
3 #include "tao/Object_T.h"
4 #include "orbsvcs/PortableGroup/MIOP.h"
6 #define MAX_MIOP_OCTET_SEQUENCE (ACE_MAX_DGRAM_SIZE - 272 /* MIOP_MAX_HEADER_SIZE */)
8 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
11 parse_args (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
16 while ((c
= get_opts ()) != -1)
20 ior
= 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
[])
42 CORBA::ORB_init (argc
, argv
);
44 if (parse_args (argc
, argv
) != 0)
47 CORBA::Object_var tmp
=
48 orb
->string_to_object(ior
);
50 /* Do an unchecked narrow since there's no way to do an is_a on
51 * a multicast reference (yet...).
53 Test::McastHello_var hello
=
54 TAO::Narrow_Utils
<Test::McastHello
>::unchecked_narrow (
57 if (CORBA::is_nil (hello
.in ()))
59 ACE_ERROR_RETURN ((LM_DEBUG
,
60 "Nil Test::Hello reference <%s>\n",
65 hello
->send_forty_two (42);
67 Test::Octets
payload (MAX_MIOP_OCTET_SEQUENCE
);
68 payload
.length (MAX_MIOP_OCTET_SEQUENCE
);
70 for (CORBA::ULong j
= 0; j
!= MAX_MIOP_OCTET_SEQUENCE
; ++j
)
75 hello
->send_large_octet_array (payload
);
81 catch (const CORBA::Exception
& ex
)
83 ex
._tao_print_exception ("Exception caught:");