Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / examples / IPC_SAP / SOCK_SAP / CPP-inclient.h
blob77b9e0947403f52def8ff382ed6b937e2315d496
1 // This file defines the Options class for CPP-inclient. IBM C++ compiler'd
2 // template auto-instantiator needs this in a separate file.
4 #ifndef __CPP_INCLIENT_H
5 #define __CPP_INCLIENT_H
7 #include "ace/SOCK_Stream.h"
8 #include "ace/Barrier.h"
9 #include "ace/Time_Value.h"
11 class Options
12 // = TITLE
13 // Define the options for this test.
15 public:
16 Options ();
17 // Constructor.
19 ~Options ();
20 // Destructor.
22 int parse_args (int argc, ACE_TCHAR *argv[]);
23 // Parse the command-line arguments.
25 const ACE_Time_Value &sleep_time () const;
26 // Return the amount of time to sleep in order to implement the
27 // proper transmission rates.
29 u_short port () const;
30 // Port of the server.
32 const ACE_TCHAR *host () const;
33 // Host of the server.
35 size_t threads () const;
36 // Number of threads.
38 const ACE_TCHAR *quit_string () const;
39 // String that shuts down the client/server.
41 ssize_t read (void *buf, size_t len, size_t &iterations);
42 // Read from the appropriate location.
44 size_t message_len () const;
45 // Returns the length of the message to send.
47 const void *message_buf () const;
48 // Returns a pointer to the message.
50 ACE_THR_FUNC thr_func ();
51 // Returns a pointer to the entry point into the thread that runs
52 // the client test function.
54 private:
55 int init ();
56 // Initialize the message we're sending to the user and set up the
57 // barrier.
59 char *shared_client_test (u_short port,
60 ACE_SOCK_Stream &cli_stream);
61 // Performs the shared behavior of the oneway and twoway client
62 // tests.
64 static void *twoway_client_test (void *);
65 // Performs the twoway test.
67 static void *oneway_client_test (void *);
68 // Performs the oneway test.
70 const ACE_TCHAR *host_;
71 // Host of the server.
73 u_short port_;
74 // Port of the server.
76 ACE_Time_Value sleep_time_;
77 // Sleep_Time value.
79 size_t threads_;
80 // Number of threads.
82 const ACE_TCHAR *quit_string_;
83 // String that shuts down the client/server.
85 size_t message_len_;
86 // Size of the message we send to the server.
88 char *message_buf_;
89 // Pointer to the message we send to the server.
91 ACE_HANDLE io_source_;
92 // Are we reading I/O from ACE_STDIN or from our generator?
94 size_t iterations_;
95 // Number of iterations.
97 char oneway_;
98 // Are we running oneway or twoway?
100 // Please leave the ; inside the parenthesis to avoid Green Hills
101 // (and probably other) compiler warning about extra ;.
102 ACE_MT (ACE_Barrier *barrier_;)
103 // Barrier used to synchronize the start of all the threads.
106 #endif /* __CPP_INCLIENT_H */