Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_POSIX_Asynch_Accept Class Reference

For the POSIX implementation this class is common for all Proactors (AIOCB/SIG/SUN). More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Accept:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Accept:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_POSIX_Asynch_Accept (ACE_POSIX_Proactor *posix_proactor)
 Constructor. More...

virtual ~ACE_POSIX_Asynch_Accept (void)
 Destructor. More...

int open (ACE_Handler &handler, ACE_HANDLE handle, const void *completion_key, ACE_Proactor *proactor=0)
int accept (ACE_Message_Block &message_block, size_t bytes_to_read, ACE_HANDLE accept_handle, const void *act, int priority, int signal_number=0)
int cancel (void)
int close ()
ACE_HANDLE get_handle (void) const
 virtual from ACE_Event_Handler. More...

void set_handle (ACE_HANDLE handle)
 virtual from ACE_Event_Handler. More...

int handle_input (ACE_HANDLE handle)
 virtual from ACE_Event_Handler Called when accept event comes up on <listen_handle>. More...

int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
 virtual from ACE_Event_Handler. More...


Private Methods

int cancel_uncompleted (int flg_notify)
 flg_notify points whether or not we should send notification about canceled accepts Parameter flg_notify can be 0 - don't send notifications about canceled accepts 1 - notify user about canceled accepts according POSIX standards we should receive notifications on canceled AIO requests. More...


Private Attributes

int flg_open_
 1 - Accept is registered in ACE_Asynch_Pseudo_Task 0 - Aceept is deregisted in ACE_Asynch_Pseudo_Task. More...

int task_lock_count_
 To prevent ACE_Asynch_Pseudo_Task from deletion while we make a call to the ACE_Asynch_Pseudo_Task This is extra cost !!! we could avoid them if all applications will follow the rule: Proactor should be deleted only after deletion all AsynchOperation objects connected with it. More...

ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * > result_queue_
 Queue of Result pointers that correspond to all the pending accept operations. More...

ACE_SYNCH_MUTEX lock_
 The lock to protect the result queue which is shared. The queue is updated by main thread in the register function call and through the auxillary thread in the deregister fun. So let us mutex it. More...


Detailed Description

For the POSIX implementation this class is common for all Proactors (AIOCB/SIG/SUN).

Definition at line 655 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Accept::ACE_POSIX_Asynch_Accept ACE_POSIX_Proactor   posix_proactor
 

Constructor.

Definition at line 790 of file POSIX_Asynch_IO.cpp.

00791   : ACE_Asynch_Operation_Impl (),
00792     ACE_Asynch_Accept_Impl (),
00793     ACE_POSIX_Asynch_Operation (posix_proactor),
00794     flg_open_ (0),
00795     task_lock_count_ (0)
00796 {
00797 }

ACE_POSIX_Asynch_Accept::~ACE_POSIX_Asynch_Accept void    [virtual]
 

Destructor.

Definition at line 799 of file POSIX_Asynch_IO.cpp.

References close, and ACE_Event_Handler::reactor.

00800 {
00801   this->close ();
00802   this->reactor(0); // to avoid purge_pending_notifications
00803 }


Member Function Documentation

int ACE_POSIX_Asynch_Accept::accept ACE_Message_Block   message_block,
size_t    bytes_to_read,
ACE_HANDLE    accept_handle,
const void *    act,
int    priority,
int    signal_number = 0
[virtual]
 

This starts off an asynchronous accept. The asynchronous accept call also allows any initial data to be returned to the <handler>. Upto <bytes_to_read> will be read and stored in the <message_block>. The <accept_handle> will be used for the <accept> call. If (<accept_handle> == INVALID_HANDLE), a new handle will be created.

<message_block> must be specified. This is because the address of the new connection is placed at the end of this buffer.

Implements ACE_Asynch_Accept_Impl.

Definition at line 875 of file POSIX_Asynch_IO.cpp.

References ACE_ERROR_RETURN, ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_NEW_RETURN, ACE_SYNCH_MUTEX, ACE_TRACE, ACE_Message_Block::base, ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * >::enqueue_tail, flg_open_, ACE_POSIX_Proactor::get_asynch_pseudo_task, LM_ERROR, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_Event_Handler::priority, result_queue_, ACE_Asynch_Pseudo_Task::resume_io_handler, ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * >::size, ACE_Message_Block::size, task_lock_count_, ACE_Asynch_Pseudo_Task::unlock_finish, and ACE_Message_Block::wr_ptr.

00881 {
00882   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::accept\n"));
00883 
00884   {
00885     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
00886 
00887     if (this->flg_open_ == 0)
00888       ACE_ERROR_RETURN ((LM_ERROR,
00889                          ACE_LIB_TEXT("%N:%l:ACE_POSIX_Asynch_Accept::accept")
00890                          ACE_LIB_TEXT("acceptor was not opened before\n")),
00891                         -1);
00892 
00893     // Sanity check: make sure that enough space has been allocated by
00894     // the caller.
00895     size_t address_size = sizeof (sockaddr_in) + sizeof (sockaddr);
00896     size_t space_in_use = message_block.wr_ptr () - message_block.base ();
00897     size_t total_size = message_block.size ();
00898     size_t available_space = total_size - space_in_use;
00899     size_t space_needed = bytes_to_read + 2 * address_size;
00900 
00901     if (available_space < space_needed)
00902       ACE_ERROR_RETURN ((LM_ERROR,
00903                          ACE_LIB_TEXT ("Buffer too small\n")),
00904                         -1);
00905 
00906     // Common code for both WIN and POSIX.
00907     // Create future Asynch_Accept_Result
00908     ACE_POSIX_Asynch_Accept_Result *result = 0;
00909     ACE_NEW_RETURN (result,
00910                     ACE_POSIX_Asynch_Accept_Result (*this->handler_,
00911                                                     this->handle_,
00912                                                     accept_handle,
00913                                                     message_block,
00914                                                     bytes_to_read,
00915                                                     act,
00916                                                     this->posix_proactor()->get_handle (),
00917                                                     priority,
00918                                                     signal_number),
00919                   -1);
00920 
00921     // Enqueue result
00922     if (this->result_queue_.enqueue_tail (result) == -1)
00923       {
00924         delete result;  // to avoid memory  leak
00925 
00926         ACE_ERROR_RETURN ((LM_ERROR,
00927                            ACE_LIB_TEXT("%N:%l:ACE_POSIX_Asynch_Accept::accept:")
00928                            ACE_LIB_TEXT("enqueue accept call failed\n")),
00929                           -1);
00930       }
00931 
00932     if (this->result_queue_.size () > 1)
00933       return 0;
00934 
00935     task_lock_count_ ++;
00936   }
00937 
00938   // If this is the only item, then it means there the set was empty
00939   // before. So enable the <handle> in the reactor.
00940 
00941   ACE_Asynch_Pseudo_Task & task =
00942     this->posix_proactor ()->get_asynch_pseudo_task ();
00943 
00944   int rc_task = task.resume_io_handler (this->get_handle());
00945 
00946   {
00947     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
00948 
00949     task_lock_count_ --;
00950 
00951     if (rc_task == -2 && task_lock_count_ == 0)  // task is closing
00952       task.unlock_finish ();
00953   }
00954 
00955   if (rc_task < 0)
00956     return -1;
00957 
00958   return 0;
00959 }

int ACE_POSIX_Asynch_Accept::cancel void    [virtual]
 

Cancel all pending pseudo-asynchronus requests Behavior as usual AIO request

Reimplemented from ACE_POSIX_Asynch_Operation.

Definition at line 1010 of file POSIX_Asynch_IO.cpp.

References ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_SYNCH_MUTEX, ACE_TRACE, cancel_uncompleted, flg_open_, ACE_POSIX_Proactor::get_asynch_pseudo_task, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_Asynch_Pseudo_Task::suspend_io_handler, task_lock_count_, and ACE_Asynch_Pseudo_Task::unlock_finish.

01011 {
01012   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::cancel\n"));
01013 
01014   //We are not really ACE_POSIX_Asynch_Operation
01015   //so we could not call ::aiocancel ()
01016   // or just write
01017   //return ACE_POSIX_Asynch_Operation::cancel ();
01018   //We delegate real cancelation to cancel_uncompleted (1)
01019 
01020   int rc = -1 ;  // ERRORS
01021 
01022   {
01023     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
01024 
01025     int num_cancelled = cancel_uncompleted (flg_open_);
01026 
01027     if (num_cancelled == 0)
01028        rc = 1 ;        // AIO_ALLDONE
01029     else if (num_cancelled > 0)
01030        rc = 0 ;        // AIO_CANCELED
01031 
01032     if (this->flg_open_ == 0)
01033        return rc ;
01034 
01035     task_lock_count_++;
01036   }
01037 
01038   ACE_Asynch_Pseudo_Task & task =
01039     this->posix_proactor ()->get_asynch_pseudo_task ();
01040 
01041   int rc_task = task.suspend_io_handler (this->get_handle());
01042 
01043   {
01044     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
01045 
01046     task_lock_count_--;
01047 
01048     if (rc_task == -2 && task_lock_count_ == 0)  // task is closing
01049        task.unlock_finish ();
01050   }
01051 
01052   return rc;
01053 }

int ACE_POSIX_Asynch_Accept::cancel_uncompleted int    flg_notify [private]
 

flg_notify points whether or not we should send notification about canceled accepts Parameter flg_notify can be 0 - don't send notifications about canceled accepts 1 - notify user about canceled accepts according POSIX standards we should receive notifications on canceled AIO requests.

Definition at line 974 of file POSIX_Asynch_IO.cpp.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * >::dequeue_head, flg_open_, LM_ERROR, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_POSIX_Proactor::post_completion, result_queue_, ACE_POSIX_Asynch_Result::set_bytes_transferred, and ACE_POSIX_Asynch_Result::set_error.

Referenced by cancel, close, and handle_close.

00975 {
00976   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::cancel_uncompleted\n"));
00977 
00978   int retval = 0;
00979 
00980   for (; ; retval++)
00981     {
00982       ACE_POSIX_Asynch_Accept_Result* result = 0;
00983 
00984       this->result_queue_.dequeue_head (result);
00985 
00986       if (result == 0)
00987         break;
00988 
00989       if (this->flg_open_ == 0 || flg_notify == 0) //if we should not notify
00990         delete result ;                            // we have to delete result
00991       else                                 //else notify as any cancelled AIO
00992         {
00993           // Store the new handle.
00994           result->aio_fildes = ACE_INVALID_HANDLE ;
00995           result->set_bytes_transferred (0);
00996           result->set_error (ECANCELED);
00997 
00998           if (this->posix_proactor ()->post_completion (result) == -1)
00999             ACE_ERROR ((LM_ERROR,
01000                         ACE_LIB_TEXT("Error:(%P | %t):%p\n"),
01001                         ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::")
01002                         ACE_LIB_TEXT("cancel_uncompleted:<post_completion> failed")
01003                         ));
01004         }
01005     }
01006   return retval;
01007 }

int ACE_POSIX_Asynch_Accept::close  
 

Close performs cancellation of all pending requests and closure the listen handle

Definition at line 1056 of file POSIX_Asynch_IO.cpp.

References ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_SYNCH_MUTEX, ACE_TRACE, cancel_uncompleted, ACE_OS::closesocket, flg_open_, ACE_POSIX_Proactor::get_asynch_pseudo_task, ACE_POSIX_Asynch_Operation::handle_, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_Asynch_Pseudo_Task::remove_io_handler, task_lock_count_, and ACE_Asynch_Pseudo_Task::unlock_finish.

Referenced by ~ACE_POSIX_Asynch_Accept.

01057 {
01058   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::close\n"));
01059 
01060   // 1. It performs cancellation of all pending requests
01061   // 2. Removes itself from Reactor ( ACE_Asynch_Pseudo_Task)
01062   // 3. close the socket
01063   //
01064   //  Parameter flg_notify can be
01065   //     0  - don't send notifications about canceled accepts
01066   //    !0  - notify user about canceled accepts
01067   //          according POSIX standards we should receive notifications
01068   //          on canceled AIO requests
01069   //
01070   //  Return codes : 0 - OK ,
01071   //                -1 - Errors
01072 
01073   {
01074     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
01075 
01076     this->cancel_uncompleted (flg_open_);
01077 
01078     if (this->flg_open_ == 0)
01079       {
01080         if (this->handle_ != ACE_INVALID_HANDLE)
01081           {
01082             ACE_OS::closesocket (this->handle_);
01083             this->handle_ = ACE_INVALID_HANDLE;
01084           }
01085         return 0;
01086       }
01087 
01088     task_lock_count_++;
01089   }
01090 
01091   ACE_Asynch_Pseudo_Task & task =
01092     this->posix_proactor ()->get_asynch_pseudo_task ();
01093 
01094   int rc_task = task.remove_io_handler (this->get_handle ());
01095 
01096   {
01097     ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
01098 
01099     task_lock_count_--;
01100 
01101     if (rc_task == -2 && task_lock_count_ == 0)  // task is closing
01102       task.unlock_finish ();
01103 
01104     if (this->handle_ != ACE_INVALID_HANDLE)
01105       {
01106         ACE_OS::closesocket (this->handle_);
01107         this->handle_ = ACE_INVALID_HANDLE;
01108       }
01109 
01110     this->flg_open_ = 0;
01111   }
01112 
01113   return 0;
01114 }

ACE_HANDLE ACE_POSIX_Asynch_Accept::get_handle void    const [virtual]
 

virtual from ACE_Event_Handler.

Reimplemented from ACE_Event_Handler.

Definition at line 806 of file POSIX_Asynch_IO.cpp.

References ACE_POSIX_Asynch_Operation::handle_.

00807 {
00808   return this->handle_;
00809 }

int ACE_POSIX_Asynch_Accept::handle_close ACE_HANDLE    handle,
ACE_Reactor_Mask    close_mask
[virtual]
 

virtual from ACE_Event_Handler.

Reimplemented from ACE_Event_Handler.

Definition at line 1117 of file POSIX_Asynch_IO.cpp.

References ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_Reactor_Mask, ACE_SYNCH_MUTEX, ACE_TRACE, cancel_uncompleted, flg_open_, ACE_POSIX_Proactor::get_asynch_pseudo_task, ACE_Asynch_Pseudo_Task::lock_finish, ACE_POSIX_Asynch_Operation::posix_proactor, and task_lock_count_.

01118 {
01119   ACE_UNUSED_ARG (handle);
01120   ACE_UNUSED_ARG (close_mask);
01121 
01122   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::handle_close\n"));
01123 
01124   ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0));
01125 
01126   // handle_close is called only in one case :
01127   //  when Asynch_accept_task is closing ( i.e. proactor destructor )
01128 
01129   // In all other cases we deregister ourself
01130   // with ACE_Event_Handler::DONT_CALL mask
01131 
01132   this->cancel_uncompleted (0);
01133 
01134   this->flg_open_ = 0;
01135 
01136   // it means other thread is waiting for reactor token_
01137   if (task_lock_count_ > 0)
01138     {
01139       ACE_Asynch_Pseudo_Task & task =
01140          this->posix_proactor ()->get_asynch_pseudo_task ();
01141 
01142       task.lock_finish ();
01143     }
01144 
01145   return 0;
01146 }

int ACE_POSIX_Asynch_Accept::handle_input ACE_HANDLE    handle [virtual]
 

virtual from ACE_Event_Handler Called when accept event comes up on <listen_handle>.

Reimplemented from ACE_Event_Handler.

Definition at line 1149 of file POSIX_Asynch_IO.cpp.

References ACE_OS::accept, ACE_ERROR, ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_SYNCH_MUTEX, ACE_TRACE, ACE_OS::closesocket, ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * >::dequeue_head, ACE_POSIX_Proactor::get_asynch_pseudo_task, LM_ERROR, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_POSIX_Proactor::post_completion, result_queue_, ACE_POSIX_Asynch_Result::set_error, ACE_Unbounded_Queue< ACE_POSIX_Asynch_Accept_Result * >::size, and ACE_Asynch_Pseudo_Task::suspend_io_handler.

01150 {
01151   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::handle_input\n"));
01152 
01153   // An <accept> has been sensed on the <listen_handle>. We should be
01154   // able to just go ahead and do the <accept> now on this <fd>. This
01155   // should be the same as the <listen_handle>.
01156 
01157   ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, 0));
01158 
01159   ACE_POSIX_Asynch_Accept_Result* result = 0;
01160 
01161   // Deregister this info pertaining to this <accept> call.
01162   if (this->result_queue_.dequeue_head (result) != 0)
01163     ACE_ERROR ((LM_ERROR,
01164                 ACE_LIB_TEXT("%N:%l:(%P | %t):%p\n"),
01165                 ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::handle_input:")
01166                 ACE_LIB_TEXT( " dequeueing failed")));
01167 
01168   // Disable the <handle> in the reactor if no <accept>'s are pending.
01169 
01170   // we allow the following sequence of locks :
01171   //    reactor::token , then our mutex lock_
01172   // to avoid deadlock prohibited reverse sequence
01173 
01174   if (this->result_queue_.size () == 0)
01175     {
01176       ACE_Asynch_Pseudo_Task & task =
01177         this->posix_proactor ()->get_asynch_pseudo_task ();
01178 
01179       task.suspend_io_handler (this->get_handle());
01180     }
01181 
01182   // Issue <accept> now.
01183   // @@ We shouldnt block here since we have already done poll/select
01184   // thru reactor. But are we sure?
01185 
01186   ACE_HANDLE new_handle = ACE_OS::accept (this->handle_, 0, 0);
01187 
01188   if (result == 0) // there is nobody to notify
01189     {
01190       ACE_OS::closesocket (new_handle);
01191       return 0;
01192     }
01193 
01194   if (new_handle == ACE_INVALID_HANDLE)
01195     {
01196       result->set_error(errno);
01197       ACE_ERROR ((LM_ERROR,
01198                   ACE_LIB_TEXT("%N:%l:(%P | %t):%p\n"),
01199                   ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::handle_input: ")
01200                   ACE_LIB_TEXT(" <accept> system call failed")));
01201 
01202       // Notify client as usual, "AIO" finished with errors
01203     }
01204 
01205   // Store the new handle.
01206   result->aio_fildes = new_handle;
01207 
01208   // Notify the main process about this completion
01209   // Send the Result through the notification pipe.
01210   if (this->posix_proactor ()->post_completion (result) == -1)
01211     ACE_ERROR ((LM_ERROR,
01212                 ACE_LIB_TEXT("Error:(%P | %t):%p\n"),
01213                 ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::handle_input: ")
01214                 ACE_LIB_TEXT(" <post_completion> failed")));
01215 
01216   return 0;
01217 }

int ACE_POSIX_Asynch_Accept::open ACE_Handler   handler,
ACE_HANDLE    handle,
const void *    completion_key,
ACE_Proactor   proactor = 0
[virtual]
 

This <open> belongs to ACE_POSIX_Asynch_Operation. We forward this call to that method. We have put this here to avoid the compiler warnings.

Reimplemented from ACE_POSIX_Asynch_Operation.

Definition at line 819 of file POSIX_Asynch_IO.cpp.

References ACE_Event_Handler::ACCEPT_MASK, ACE_ERROR_RETURN, ACE_GUARD_RETURN, ACE_LIB_TEXT, ACE_MT, ACE_SYNCH_MUTEX, ACE_TRACE, flg_open_, ACE_POSIX_Proactor::get_asynch_pseudo_task, ACE_POSIX_Asynch_Operation::handle_, LM_ERROR, ACE_POSIX_Asynch_Operation::open, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_Asynch_Pseudo_Task::register_io_handler, and task_lock_count_.

00823 {
00824   ACE_TRACE (ACE_LIB_TEXT("ACE_POSIX_Asynch_Accept::open\n"));
00825 
00826   int result=0;
00827 
00828   ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->lock_, -1));
00829 
00830   // if we are already opened,
00831   // we could not create a new handler without closing the previous
00832 
00833   if (this->flg_open_ != 0)
00834     ACE_ERROR_RETURN ((LM_ERROR,
00835                        ACE_LIB_TEXT("%N:%l:ACE_POSIX_Asynch_Accept::open:")
00836                        ACE_LIB_TEXT("acceptor already open \n")),
00837                       -1);
00838 
00839   result = ACE_POSIX_Asynch_Operation::open (handler,
00840                                              handle,
00841                                              completion_key,
00842                                              proactor);
00843   if (result == -1)
00844     return result;
00845 
00846   flg_open_ = 1;
00847 
00848   task_lock_count_++;
00849 
00850   // At this moment asynch_accept_task does not know about us,
00851   // so we can lock task's token with our lock_ locked.
00852   // In all other cases we should release our lock_ before
00853   // calling task's methods to avoid deadlock
00854   ACE_Asynch_Pseudo_Task & task =
00855     this->posix_proactor()->get_asynch_pseudo_task();
00856 
00857   result = task.register_io_handler (this->get_handle(),
00858                                      this,
00859                                      ACE_Event_Handler::ACCEPT_MASK,
00860                                      1);  // suspend after register
00861 
00862   task_lock_count_-- ;
00863 
00864   if (result < 0)
00865     {
00866       this->flg_open_= 0;
00867       this->handle_ = ACE_INVALID_HANDLE;
00868       return -1 ;
00869     }
00870 
00871   return 0;
00872 }

void ACE_POSIX_Asynch_Accept::set_handle ACE_HANDLE    handle [virtual]
 

virtual from ACE_Event_Handler.

Reimplemented from ACE_Event_Handler.

Definition at line 812 of file POSIX_Asynch_IO.cpp.

References ACE_ASSERT, and ACE_POSIX_Asynch_Operation::handle_.

00813 {
00814   ACE_ASSERT (handle_ == ACE_INVALID_HANDLE);
00815   this->handle_ = handle;
00816 }


Member Data Documentation

int ACE_POSIX_Asynch_Accept::flg_open_ [private]
 

1 - Accept is registered in ACE_Asynch_Pseudo_Task 0 - Aceept is deregisted in ACE_Asynch_Pseudo_Task.

Definition at line 733 of file POSIX_Asynch_IO.h.

Referenced by accept, cancel, cancel_uncompleted, close, handle_close, and open.

ACE_SYNCH_MUTEX ACE_POSIX_Asynch_Accept::lock_ [private]
 

The lock to protect the result queue which is shared. The queue is updated by main thread in the register function call and through the auxillary thread in the deregister fun. So let us mutex it.

Definition at line 751 of file POSIX_Asynch_IO.h.

ACE_Unbounded_Queue<ACE_POSIX_Asynch_Accept_Result*> ACE_POSIX_Asynch_Accept::result_queue_ [private]
 

Queue of Result pointers that correspond to all the pending accept operations.

Definition at line 745 of file POSIX_Asynch_IO.h.

Referenced by accept, cancel_uncompleted, and handle_input.

int ACE_POSIX_Asynch_Accept::task_lock_count_ [private]
 

To prevent ACE_Asynch_Pseudo_Task from deletion while we make a call to the ACE_Asynch_Pseudo_Task This is extra cost !!! we could avoid them if all applications will follow the rule: Proactor should be deleted only after deletion all AsynchOperation objects connected with it.

Definition at line 741 of file POSIX_Asynch_IO.h.

Referenced by accept, cancel, close, handle_close, and open.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:52:18 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002