2 // This file defines the Options class for SSL-client. IBM C++ compiler'd
3 // template auto-instantiator needs this in a separate file.
5 #ifndef __ACE_SSL_CLIENT_H
6 #define __ACE_SSL_CLIENT_H
8 #include "ace/Barrier.h"
9 #include "ace/Time_Value.h"
11 #include "ace/SSL/SSL_SOCK_Stream.h"
13 /// Define the options for this test.
23 // Parse the command-line arguments.
24 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
26 // Return the amount of time to sleep in order to implement the
27 // proper transmission rates.
28 const ACE_Time_Value
&sleep_time () const;
30 // Port of the server.
31 u_short
port () const;
33 // Host of the server.
34 const ACE_TCHAR
*host () const;
37 size_t threads () const;
39 // String that shuts down the client/server.
40 const char *quit_string () const;
42 // Read from the appropriate location.
43 ssize_t
read (void *buf
, size_t len
, size_t &iterations
);
45 // Returns the length of the message to send.
46 size_t message_len () const;
48 // Returns a pointer to the message.
49 const void *message_buf () const;
51 // Returns a pointer to the entry point into the thread that runs
52 // the client test function.
53 ACE_THR_FUNC
thr_func ();
56 // Initialize the message we're sending to the user and set up the
60 // Performs the shared behavior of the oneway and twoway client
62 char *shared_client_test (u_short port
,
63 ACE_SSL_SOCK_Stream
&cli_stream
);
65 // Performs the twoway test.
66 static void *twoway_client_test (void *);
68 // Performs the oneway test.
69 static void *oneway_client_test (void *);
71 // Host of the server.
72 const ACE_TCHAR
*host_
;
74 // Port of the server.
78 ACE_Time_Value sleep_time_
;
83 // String that shuts down the client/server.
84 enum {QUIT_STRING_SIZE
= 128};
85 char quit_string_
[QUIT_STRING_SIZE
+ 1];
88 // Size of the message we send to the server.
91 // Pointer to the message we send to the server.
93 ACE_HANDLE io_source_
;
94 // Are we reading I/O from ACE_STDIN or from our generator?
97 // Number of iterations.
100 // Are we running oneway or twoway?
102 // Please leave the ; inside the parenthesis to avoid Green Hills
103 // (and probably other) compiler warning about extra ;.
104 ACE_MT (ACE_Barrier
*barrier_
;)
105 // Barrier used to synchronize the start of all the threads.
108 #endif /* __ACE_SSL_CLIENT_H */