summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2001-10-22 01:24:56 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2001-10-22 01:24:56 +0000
commit740f07c79256b193bc66a3f65862470a5f221197 (patch)
tree9602030c374e9ff3c044ac270f1b453028e773fa /tests
parent4afa10f31117643fc014ec95c5dd9fa8d5231999 (diff)
downloadATCD-740f07c79256b193bc66a3f65862470a5f221197.tar.gz
ChangeLogTag:Sun Oct 21 16:44:41 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'tests')
-rw-r--r--tests/Proactor_Test.cpp38
1 files changed, 4 insertions, 34 deletions
diff --git a/tests/Proactor_Test.cpp b/tests/Proactor_Test.cpp
index 75d02056e2c..ada03a6de7a 100644
--- a/tests/Proactor_Test.cpp
+++ b/tests/Proactor_Test.cpp
@@ -94,7 +94,6 @@ static char data[] =
"Connection: Keep-Alive\r\n"
"\r\n" ;
-
// *************************************************************
// MyTask is ACE_Task resposible for :
// 1. creation and deletion of
@@ -114,24 +113,20 @@ static char data[] =
class MyTask : public ACE_Task<ACE_MT_SYNCH>
{
public:
-
- MyTask (void) : threads_ (0), proactor_ (0) {}
+ MyTask (void): threads_ (0), proactor_ (0) {}
int svc (void);
void waitready (void) { this->event_.wait (); }
private:
-
void create_proactor (void);
void delete_proactor (void);
private:
-
ACE_SYNCH_RECURSIVE_MUTEX lock_;
int threads_;
ACE_Proactor *proactor_;
ACE_Manual_Event event_;
-
};
void
@@ -243,9 +238,7 @@ class Receiver : public ACE_Service_Handler
{
friend class Acceptor;
public:
-
Receiver (Acceptor *acceptor = 0, int index = -1);
-
~Receiver (void);
/// This is called after the new connection has been accepted.
@@ -253,7 +246,6 @@ public:
ACE_Message_Block &message_block);
protected:
-
/**
* @name AIO callback handling
*
@@ -268,13 +260,10 @@ protected:
virtual void handle_write_stream (const ACE_Asynch_Write_Stream::Result &result);
private:
-
int initiate_read_stream (void);
int initiate_write_stream (ACE_Message_Block &mb, int nbytes);
int check_destroy (void);
-private:
-
Acceptor *acceptor_;
int index_;
@@ -284,15 +273,12 @@ private:
ACE_SYNCH_RECURSIVE_MUTEX lock_;
long io_count_;
-
};
class Acceptor : public ACE_Asynch_Acceptor<Receiver>
{
friend class Receiver;
-
public:
-
long get_number_sessions (void) { return this->sessions_; }
Acceptor (void);
@@ -304,16 +290,12 @@ public:
Receiver *make_handler (void);
private:
-
void on_new_receiver (Receiver &rcvr);
void on_delete_receiver (Receiver &rcvr);
-private:
-
ACE_SYNCH_RECURSIVE_MUTEX lock_;
long sessions_;
Receiver *list_receivers_[MAX_RECEIVERS];
-
};
Acceptor::Acceptor (void)
@@ -344,7 +326,6 @@ Acceptor::stop(void)
}
}
-
void
Acceptor::on_new_receiver (Receiver & rcvr)
{
@@ -647,7 +628,6 @@ Receiver::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
class Sender : public ACE_Service_Handler
{
public:
-
static long get_number_sessions (void) { return sessions_; }
static void init (void);
static int activate (int num);
@@ -656,7 +636,6 @@ public:
int open_sender (const ACE_TCHAR *host, u_short port);
protected:
-
// These methods are called by the freamwork
Sender (int index);
~Sender (void);
@@ -668,13 +647,10 @@ protected:
// This is called when asynchronous writes from the socket complete
private:
-
int check_destroy (void);
int initiate_read_stream (void);
int initiate_write_stream (void);
-private:
-
int index_;
char send_buf_[1024];
@@ -1203,11 +1179,9 @@ main (int argc, ACE_TCHAR *argv[])
int rc = 0;
if (both != 0 || host == 0) // Acceptor
- {
- // Simplify, initial read with zero size
- if (acceptor.open (ACE_INET_Addr (port), 0, 1) == 0)
- rc = 1;
- }
+ // Simplify, initial read with zero size
+ if (acceptor.open (ACE_INET_Addr (port), 0, 1) == 0)
+ rc = 1;
if (both != 0 || host != 0)
{
@@ -1257,18 +1231,14 @@ disable_signal (int sigmin, int sigmax)
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Error: (%P|%t):%p\n"),
ACE_TEXT ("pthread_sigmask failed")));
-
#else
-
ACE_UNUSED_ARG (sigmin);
ACE_UNUSED_ARG (sigmax);
-
#endif /* ACE_WIN32 */
return 1;
}
-
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Asynch_Acceptor<Receiver>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)