Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / IPC_SAP / SSL_SAP / SSL-client-simple.h
blob80456d84a7884ae88e5dc84ff8e6f50238d9ddf0
1 // -*- C++ -*-
2 // This file defines the Options class for SSL-client-simple. IBM C++
3 // compiler's template auto-instantiator needs this in a separate file.
5 #ifndef ACE_SSL_CLIENT_SIMPLE_H
6 #define ACE_SSL_CLIENT_SIMPLE_H
8 #include "ace/SSL/SSL_SOCK_Stream.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 const char *quit_string () const;
36 // String that shuts down the client/server.
38 ssize_t read (void *buf, size_t len, size_t &iterations);
39 // Read from the appropriate location.
41 size_t message_len () const;
42 // Returns the length of the message to send.
44 const void *message_buf () const;
45 // Returns a pointer to the message.
47 void run ();
48 // Run the test
50 private:
51 int init ();
52 // Initialize the message we're sending to the user and set up the
53 // barrier.
55 char *shared_client_test (u_short port,
56 ACE_SSL_SOCK_Stream &cli_stream);
57 // Performs the shared behavior of the oneway and twoway client
58 // tests.
60 void twoway_client_test ();
61 // Performs the twoway test.
63 void oneway_client_test ();
64 // Performs the oneway test.
66 const ACE_TCHAR *host_;
67 // Host of the server.
69 u_short port_;
70 // Port of the server.
72 ACE_Time_Value sleep_time_;
73 // Sleep_Time value.
75 enum {QUIT_STRING_SIZE = 128};
76 char quit_string_[QUIT_STRING_SIZE + 1];
77 // String that shuts down the client/server.
79 size_t message_len_;
80 // Size of the message we send to the server.
82 char *message_buf_;
83 // Pointer to the message we send to the server.
85 ACE_HANDLE io_source_;
86 // Are we reading I/O from ACE_STDIN or from our generator?
88 size_t iterations_;
89 // Number of iterations.
91 char oneway_;
92 // Are we running oneway or twoway?
95 #endif /* ACE_SSL_CLIENT_SIMPLE_H */