From 411ced7dd54e196a407e03860400fd73dac7c9d8 Mon Sep 17 00:00:00 2001 From: irfan Date: Wed, 29 Jul 1998 19:12:04 +0000 Subject: *** empty log message *** --- ace/Asynch_Acceptor.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'ace/Asynch_Acceptor.cpp') diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index fe7dda8c064..b7d076ab9dd 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -44,7 +44,8 @@ ACE_Asynch_Acceptor::open (const ACE_INET_Addr &address, int reuse_addr, ACE_Proactor *proactor, int validate_new_connection, - int reissue_accept) + int reissue_accept, + int number_of_initial_accepts) { this->proactor (proactor); this->pass_addresses_ = pass_addresses; @@ -97,9 +98,11 @@ ACE_Asynch_Acceptor::open (const ACE_INET_Addr &address, "%p\n", "ACE_OS::listen"), -1); - // For the number of . + // For the number of . + if (number_of_initial_accepts == -1) + number_of_initial_accepts = backlog; - for (int i = 0; i < backlog; i++) + for (int i = 0; i < number_of_initial_accepts; i++) // Initiate accepts. if (this->accept (bytes_to_read) == -1) ACE_ERROR_RETURN ((LM_ERROR, @@ -108,6 +111,24 @@ ACE_Asynch_Acceptor::open (const ACE_INET_Addr &address, return 0; } +template void +ACE_Asynch_Acceptor::set_handle (ACE_HANDLE listen_socket) +{ + // Take ownership of the + this->listen_socket_ = listen_socket; + + // Initialize the ACE_Asynch_Accept + this->asynch_accept_.set_handle (this->listen_handle_); + + return 0; +} + +template ACE_HANDLE +ACE_Asynch_Acceptor::get_handle (void) const +{ + return this->listen_socket_; +} + template int ACE_Asynch_Acceptor::accept (size_t bytes_to_read) { -- cgit v1.2.1