1 #include "UDP_Client_i.h"
2 #include "ace/SString.h"
3 #include "ace/OS_NS_unistd.h"
5 // This is the interface program that accesses the remote object
8 UDP_Client_i::UDP_Client_i (CORBA::ORB_ptr orb
,
12 ACE_UINT32 iterations
)
13 : orb_ (CORBA::ORB::_duplicate (orb
))
14 , udp_ (UDP::_duplicate (udp
))
15 , udpHandler_ (UDP::_duplicate (udpHandler
))
17 , iterations_ (iterations
)
22 UDP_Client_i::~UDP_Client_i ()
30 ACE_CString
client_name ("UDP");
35 static_cast<u_int
> (ACE_OS::getpid ()));
42 CORBA::String_var corba_client_name
=
43 CORBA::string_dup (client_name
.c_str ());
45 for (ACE_UINT32 i
= 0;
49 udp_
->invoke (corba_client_name
.in (),
54 "invoked %C %d, going to wait %d ms\n",
55 corba_client_name
.in (),
58 ACE_Time_Value
tv (0, delay_
* 1000);
59 ACE_OS::sleep (tv
); // wait to not flood the server
62 // shut down remote ORB
63 for (int c
= 0; c
< 10; ++c
)
66 ACE_Time_Value
tv (0, 500); // 50ms
67 ACE_OS::sleep (tv
); // let the previous request go through
69 // Shut down local ORB, trigger the end of the ORB event loop
70 // in the main thread.
73 catch (const CORBA::Exception
& ex
)
75 ex
._tao_print_exception ("\tException");