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"
13 // Define the options for this test.
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;
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.
56 // Initialize the message we're sending to the user and set up the
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
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.
74 // Port of the server.
76 ACE_Time_Value sleep_time_
;
82 const ACE_TCHAR
*quit_string_
;
83 // String that shuts down the client/server.
86 // Size of the message we send to the server.
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?
95 // Number of iterations.
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 */