Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / examples / Simple / time / Time_Client_i.cpp
blob87feb97e0999896733d14b26badc48b1f14b9e82
1 #include "Time_Client_i.h"
2 #include "ace/OS_NS_time.h"
4 // This is the interface program that accesses the remote object
6 // Constructor.
7 Time_Client_i::Time_Client_i ()
9 //no-op
12 //Destructor.
13 Time_Client_i::~Time_Client_i ()
15 //no-op
18 int
19 Time_Client_i::run (const char *name,
20 int argc,
21 ACE_TCHAR *argv[])
23 // Initialize the client.
24 if (client_.init (name, argc, argv) == -1)
25 return -1;
27 try
29 // 64-bit OS's require pointers to be aligned on an
30 // 8 byte boundary.
31 CORBA::Long padding = 0;
32 time_t timedate;
34 ACE_UNUSED_ARG (padding);
36 //Make the RMI.
37 timedate = static_cast <time_t> (client_->current_time ());
39 // Print out value
40 ACE_TCHAR ascii_timedate[64] = ACE_TEXT ("");
42 ACE_OS::ctime_r (&timedate, ascii_timedate, 64);
44 ACE_DEBUG ((LM_DEBUG,
45 ACE_TEXT ("string time is %s\n"),
46 ascii_timedate));
48 if (client_.do_shutdown () == 1)
49 client_->shutdown ();
51 catch (const CORBA::Exception& ex)
53 ex._tao_print_exception ("\tException");
54 return -1;
57 return 0;