Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / drwho / client.cpp
blob4f49ff6c1b2500f0d915fee48866c4734713aea4
2 //=============================================================================
3 /**
4 * @file client.cpp
6 * Client driver program for drwho.
8 * @author Douglas C. Schmidt
9 */
10 //=============================================================================
13 #include "ace/Log_Msg.h"
15 #include "Options.h"
16 #include "SML_Client.h"
17 #include "SMR_Client.h"
18 #include "ace/OS_Memory.h"
20 // Factory function.
22 static SM_Client *
23 make_client ()
25 SM_Client *client = 0;
27 if (Options::get_opt (Options::REMOTE_USAGE) == 0)
28 ACE_NEW_RETURN (client,
29 SML_Client,
30 0);
31 else
32 ACE_NEW_RETURN (client,
33 SMR_Client (Options::port_number),
34 0);
35 return client;
38 int
39 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
41 Options::set_options (argc, argv);
43 SM_Client *sm_client = make_client ();
45 if (sm_client->send () < 0)
46 ACE_ERROR_RETURN ((LM_ERROR,
47 "%p\n",
48 Options::program_name),
49 -1);
51 if (sm_client->receive (Options::max_server_timeout) < 0)
52 ACE_ERROR_RETURN ((LM_ERROR,
53 "%p\n",
54 Options::program_name),
55 -1);
57 sm_client->process ();
59 return 0;