summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-21 20:48:26 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-21 20:48:26 +0000
commitcf756f95d14d303143d8a92cc7978fc7d251d8b4 (patch)
tree16e705afdcebf39326e14bb8dd3f468c8f3dca5c
parent433452b7360fa127fb12913a90685007e3b9d0ad (diff)
downloadATCD-cf756f95d14d303143d8a92cc7978fc7d251d8b4.tar.gz
.
-rw-r--r--ace/Acceptor.cpp13
-rw-r--r--ace/Acceptor.h18
2 files changed, 22 insertions, 9 deletions
diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp
index 2f56a897ba3..b18f485223c 100644
--- a/ace/Acceptor.cpp
+++ b/ace/Acceptor.cpp
@@ -57,7 +57,8 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
(const ACE_PEER_ACCEPTOR_ADDR &local_addr,
ACE_Reactor *reactor,
int flags,
- int use_select)
+ int use_select,
+ int reuse_addr)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open");
this->flags_ = flags;
@@ -71,10 +72,11 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
return -1;
}
- if (this->peer_acceptor_.open (local_addr, 1) == -1)
+ if (this->peer_acceptor_.open (local_addr, reuse_addr) == -1)
return -1;
- int result = reactor->register_handler (this, ACE_Event_Handler::ACCEPT_MASK);
+ int result = reactor->register_handler (this,
+ ACE_Event_Handler::ACCEPT_MASK);
if (result == 0)
this->reactor (reactor);
@@ -98,11 +100,12 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor
(const ACE_PEER_ACCEPTOR_ADDR &addr,
ACE_Reactor *reactor,
int flags,
- int use_select)
+ int use_select,
+ int reuse_addr)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor");
- if (this->open (addr, reactor, flags, use_select) == -1)
+ if (this->open (addr, reactor, flags, use_select, reuse_addr) == -1)
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("%p\n"),
ASYS_TEXT ("ACE_Acceptor::ACE_Acceptor")));
diff --git a/ace/Acceptor.h b/ace/Acceptor.h
index 22bd133c016..20954349721 100644
--- a/ace/Acceptor.h
+++ b/ace/Acceptor.h
@@ -55,24 +55,34 @@ public:
ACE_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
ACE_Reactor * = ACE_Reactor::instance (),
int flags = 0,
- int use_select = 1);
+ int use_select = 1,
+ int reuse_addr = 1);
// Initialize and register <this> with the Reactor and listen for
// connection requests at the designated <local_addr>. <flags>
// indicates how <SVC_HANDLER>'s should be initialized prior to
// being activated. Right now, the only flag that is processed is
// <ACE_NONBLOCK>, which enabled non-blocking I/O on the
- // <SVC_HANDLER> when it is opened.
+ // <SVC_HANDLER> when it is opened. If <use_select> is non-zero
+ // then <select> is used to determine when to break out of the
+ // <accept> loop. <reuse_addr> is passed down to the
+ // <PEER_ACCEPTOR>. If it is non-zero this will allow the OS to
+ // reuse this listen port.
int open (const ACE_PEER_ACCEPTOR_ADDR &,
ACE_Reactor * = ACE_Reactor::instance (),
int flags = 0,
- int use_select = 1);
+ int use_select = 1,
+ int reuse_addr = 1);
// Initialize and register <this> with the Reactor and listen for
// connection requests at the designated <local_addr>. <flags>
// indicates how <SVC_HANDLER>'s should be initialized prior to
// being activated. Right now, the only flag that is processed is
// <ACE_NONBLOCK>, which enabled non-blocking I/O on the
- // <SVC_HANDLER> when it is opened.
+ // <SVC_HANDLER> when it is opened. If <use_select> is non-zero
+ // then <select> is used to determine when to break out of the
+ // <accept> loop. <reuse_addr> is passed down to the
+ // <PEER_ACCEPTOR>. If it is non-zero this will allow the OS to
+ // reuse this listen port.
virtual ~ACE_Acceptor (void);
// Close down the Acceptor's resources.