ACE_POSIX_Asynch_Accept_Result Class Reference

This is that class which will be passed back to the handler when the asynchronous accept completes. More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Accept_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Accept_Result:

Collaboration graph
[legend]
List of all members.

Public Member Functions

size_t bytes_to_read (void) const
ACE_Message_Blockmessage_block (void) const
 Message block which contains the read data.

ACE_HANDLE listen_handle (void) const
 I/O handle used for accepting new connections.

ACE_HANDLE accept_handle (void) const
 I/O handle for the new connection.


Protected Member Functions

 ACE_POSIX_Asynch_Accept_Result (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE listen_handle, ACE_HANDLE accept_handle, ACE_Message_Block &message_block, size_t bytes_to_read, const void *act, ACE_HANDLE event, int priority, int signal_number)
virtual void complete (size_t bytes_transferred, int success, const void *completion_key, u_long error)
 ACE_Proactor will call this method when the accept completes.

virtual ~ACE_POSIX_Asynch_Accept_Result (void)
 Destructor.


Protected Attributes

ACE_Message_Blockmessage_block_
 Message block for reading the data into.

ACE_HANDLE listen_handle_
 I/O handle used for accepting new connections.


Friends

class ACE_POSIX_Asynch_Accept
 Factory classes will have special permissions.

class ACE_POSIX_Proactor
 The Proactor constructs the Result class for faking results.


Detailed Description

This is that class which will be passed back to the handler when the asynchronous accept completes.

This class has all the information necessary for the handler to uniquiely identify the completion of the asynchronous accept.

Definition at line 596 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Accept_Result::ACE_POSIX_Asynch_Accept_Result const ACE_Handler::Proxy_Ptr handler_proxy,
ACE_HANDLE  listen_handle,
ACE_HANDLE  accept_handle,
ACE_Message_Block message_block,
size_t  bytes_to_read,
const void *  act,
ACE_HANDLE  event,
int  priority,
int  signal_number
[protected]
 

Constructor is protected since creation is limited to ACE_Asynch_Accept factory.

Definition at line 731 of file POSIX_Asynch_IO.cpp.

References ACE_Handler::Proxy_Ptr.

00741   : ACE_POSIX_Asynch_Result
00742       (handler_proxy, act, event, 0, 0, priority, signal_number),
00743     message_block_ (message_block),
00744     listen_handle_ (listen_handle)
00745 {
00746   this->aio_fildes = accept_handle;
00747   this->aio_nbytes = bytes_to_read;
00748 }

ACE_POSIX_Asynch_Accept_Result::~ACE_POSIX_Asynch_Accept_Result void   )  [protected, virtual]
 

Destructor.

Definition at line 774 of file POSIX_Asynch_IO.cpp.

00775 {
00776 }


Member Function Documentation

ACE_HANDLE ACE_POSIX_Asynch_Accept_Result::accept_handle void   )  const [virtual]
 

I/O handle for the new connection.

Implements ACE_Asynch_Accept_Result_Impl.

Definition at line 725 of file POSIX_Asynch_IO.cpp.

00726 {
00727   return this->aio_fildes;
00728 }

size_t ACE_POSIX_Asynch_Accept_Result::bytes_to_read void   )  const [virtual]
 

The number of bytes which were requested at the start of the asynchronous accept.

Implements ACE_Asynch_Accept_Result_Impl.

Definition at line 707 of file POSIX_Asynch_IO.cpp.

00708 {
00709   return this->aio_nbytes;
00710 }

void ACE_POSIX_Asynch_Accept_Result::complete size_t  bytes_transferred,
int  success,
const void *  completion_key,
u_long  error
[protected, virtual]
 

ACE_Proactor will call this method when the accept completes.

Implements ACE_Asynch_Result_Impl.

Definition at line 751 of file POSIX_Asynch_IO.cpp.

References ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::get(), ACE_Handler::handle_accept(), and ACE_Message_Block::wr_ptr().

00755 {
00756   // Copy the data.
00757   this->bytes_transferred_ = bytes_transferred;
00758   this->success_ = success;
00759   this->completion_key_ = completion_key;
00760   this->error_ = error;
00761 
00762   // Appropriately move the pointers in the message block.
00763   this->message_block_.wr_ptr (bytes_transferred);
00764 
00765   // Create the interface result class.
00766   ACE_Asynch_Accept::Result result (this);
00767 
00768   // Call the application handler.
00769   ACE_Handler *handler = this->handler_proxy_.get ()->handler ();
00770   if (handler != 0)
00771     handler->handle_accept (result);
00772 }

ACE_HANDLE ACE_POSIX_Asynch_Accept_Result::listen_handle void   )  const [virtual]
 

I/O handle used for accepting new connections.

Implements ACE_Asynch_Accept_Result_Impl.

Definition at line 719 of file POSIX_Asynch_IO.cpp.

00720 {
00721   return this->listen_handle_;
00722 }

ACE_Message_Block & ACE_POSIX_Asynch_Accept_Result::message_block void   )  const [virtual]
 

Message block which contains the read data.

Implements ACE_Asynch_Accept_Result_Impl.

Definition at line 713 of file POSIX_Asynch_IO.cpp.

00714 {
00715   return this->message_block_;
00716 }


Friends And Related Function Documentation

friend class ACE_POSIX_Asynch_Accept [friend]
 

Factory classes will have special permissions.

Definition at line 600 of file POSIX_Asynch_IO.h.

friend class ACE_POSIX_Proactor [friend]
 

The Proactor constructs the Result class for faking results.

Definition at line 603 of file POSIX_Asynch_IO.h.


Member Data Documentation

ACE_HANDLE ACE_POSIX_Asynch_Accept_Result::listen_handle_ [protected]
 

I/O handle used for accepting new connections.

Definition at line 649 of file POSIX_Asynch_IO.h.

ACE_Message_Block& ACE_POSIX_Asynch_Accept_Result::message_block_ [protected]
 

Message block for reading the data into.

Definition at line 646 of file POSIX_Asynch_IO.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:26:29 2006 for ACE by doxygen 1.3.6