Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / tests / Reactor_Performance_Test.h
blobf7282864f734ee57111b70b15be5e86ecd694f45
2 //=============================================================================
3 /**
4 * @file Reactor_Performance_Test.h
6 * This file includes template class definitions for the
7 * Reactor_Performance_Test.cpp program. This class gets its own
8 * header file to work around AIX C++ compiler "features" related
9 * to template instantiation...
11 * @author Irfan Pyarali <irfan@cs.wustl.edu> and Steve Huston <shuston@riverace.com>
13 //=============================================================================
16 #ifndef ACE_TESTS_REACTOR_PERFORMANCE_TEST_H
17 #define ACE_TESTS_REACTOR_PERFORMANCE_TEST_H
19 #include "ace/SOCK_Stream.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "ace/Svc_Handler.h"
27 /**
28 * @class Read_Handler
30 * @brief Simple class for reading in the data
32 class Read_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH>
34 public:
35 static void set_countdown (int nconnections);
37 /// The Svc_Handler callbacks.
38 virtual int open (void *);
39 virtual int handle_input (ACE_HANDLE h);
40 virtual int handle_close (ACE_HANDLE handle,
41 ACE_Reactor_Mask close_mask);
43 private:
44 /// How many connections are we waiting for.
45 static int waiting_;
48 /**
49 * @class Write_Handler
51 * @brief This Svc_Handler simply connects to a server and sends some
52 * output to it. Its purpose is to feed the test.
54 class Write_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_SYNCH>
56 public:
57 virtual int open (void *);
58 virtual int send_data (void);
61 #endif /* ACE_TESTS_REACTOR_PERFORMANCE_TEST_H */