summaryrefslogtreecommitdiff
path: root/tests/Proactor_Test.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Proactor_Test.h')
-rw-r--r--tests/Proactor_Test.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/Proactor_Test.h b/tests/Proactor_Test.h
index 6d36e5fe137..044839a4cb5 100644
--- a/tests/Proactor_Test.h
+++ b/tests/Proactor_Test.h
@@ -24,15 +24,16 @@
#include "ace/Thread_Mutex.h"
// forward declaration
-class Acceptor;
+class TestData;
-class Receiver : public ACE_Service_Handler
+class Server : public ACE_Service_Handler
{
- friend class Acceptor;
public:
- Receiver (Acceptor *acceptor = 0, int index = -1);
- ~Receiver (void);
+ Server ();
+ Server (TestData *tester, int id);
+ ~Server (void);
+ int id (void) { return this->id_; }
size_t get_total_snd (void) { return this->total_snd_; }
size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
@@ -45,6 +46,7 @@ public:
/// This is called after the new connection has been accepted.
virtual void open (ACE_HANDLE handle,
ACE_Message_Block &message_block);
+ void cancel ();
protected:
/**
@@ -63,10 +65,9 @@ protected:
private:
int initiate_read_stream (void);
int initiate_write_stream (ACE_Message_Block &mb, size_t nbytes);
- void cancel ();
- Acceptor *acceptor_;
- int index_;
+ TestData *tester_;
+ int id_;
ACE_Asynch_Read_Stream rs_;
ACE_Asynch_Write_Stream ws_;
@@ -82,23 +83,22 @@ private:
};
// *******************************************
-// Sender
+// Client
// *******************************************
-class Connector;
-
-class Sender : public ACE_Service_Handler
+class Client : public ACE_Service_Handler
{
- friend class Connector;
public:
/// This is called after the new connection has been established.
virtual void open (ACE_HANDLE handle,
ACE_Message_Block &message_block);
- Sender (Connector *connector = 0, int index = -1);
- ~Sender (void);
+ Client ();
+ Client (TestData *tester, int id);
+ ~Client (void);
+ int id (void) { return this->id_; }
size_t get_total_snd (void) { return this->total_snd_; }
size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
@@ -114,14 +114,15 @@ public:
virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result);
// This is called when asynchronous writes from the socket complete
+ void cancel (void);
+
private:
int initiate_read_stream (void);
int initiate_write_stream (void);
- void cancel (void);
void close (void);
- int index_;
- Connector * connector_;
+ TestData *tester_;
+ int id_;
ACE_Asynch_Read_Stream rs_;
ACE_Asynch_Write_Stream ws_;