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

ACE_WIN32_Asynch_Read_Dgram_Result Class Reference

This class provides concrete implementation for ACE_Asynch_Read_Dgram::Result class. More...

#include <WIN32_Asynch_IO.h>

Inheritance diagram for ACE_WIN32_Asynch_Read_Dgram_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_WIN32_Asynch_Read_Dgram_Result:

Collaboration graph
[legend]
List of all members.

Public Methods

size_t bytes_to_read (void) const
 The number of bytes which were requested at the start of the asynchronous read. More...

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

int remote_address (ACE_Addr &addr) const
 The address of where the packet came from. More...

sockaddr * saddr () const
int flags (void) const
 The flags used in the read. More...

ACE_HANDLE handle (void) const
 I/O handle used for reading. More...

size_t bytes_transferred (void) const
 Number of bytes transferred by the operation. More...

const void * act (void) const
 ACT associated with the operation. More...

int success (void) const
 Did the operation succeed? More...

const void * completion_key (void) const
u_long error (void) const
 Error value if the operation fail. More...

ACE_HANDLE event (void) const
 Event associated with the OVERLAPPED structure. More...

u_long offset (void) const
 This really make sense only when doing file I/O. More...

u_long offset_high (void) const
 Offset_high associated with the OVERLAPPED structure. More...

int priority (void) const
 The priority of the asynchronous operation. Currently, this is not supported on Win32. More...

int signal_number (void) const
 No-op. Returns 0. More...

int post_completion (ACE_Proactor_Impl *proactor)
 Post <this> to the Proactor's completion port. More...


Protected Methods

 ACE_WIN32_Asynch_Read_Dgram_Result (ACE_Handler &handler, ACE_HANDLE handle, ACE_Message_Block *message_block, size_t bytes_to_read, int flags, int protocol_family, const void *act, ACE_HANDLE event, int priority, int signal_number=0)
 Constructor is protected since creation is limited to ACE_Asynch_Read_Dgram factory. More...

virtual void complete (size_t bytes_transferred, int success, const void *completion_key, u_long error)
 Proactor will call this method when the read completes. More...

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


Protected Attributes

size_t bytes_to_read_
 Bytes requested when the asynchronous read was initiated. More...

ACE_Message_Blockmessage_block_
 Message block for reading the data into. More...

ACE_Addrremote_address_
 The address of where the packet came from. More...

int addr_len_
int flags_
 The flags used in the read. More...

ACE_HANDLE handle_
 I/O handle used for reading. More...


Friends

class ACE_WIN32_Asynch_Read_Dgram
 Factory class will have special permissions. More...

class ACE_WIN32_Proactor
 Proactor class has special permission. More...


Detailed Description

This class provides concrete implementation for ACE_Asynch_Read_Dgram::Result class.

Definition at line 1569 of file WIN32_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_WIN32_Asynch_Read_Dgram_Result::ACE_WIN32_Asynch_Read_Dgram_Result ACE_Handler   handler,
ACE_HANDLE    handle,
ACE_Message_Block   message_block,
size_t    bytes_to_read,
int    flags,
int    protocol_family,
const void *    act,
ACE_HANDLE    event,
int    priority,
int    signal_number = 0
[protected]
 

Constructor is protected since creation is limited to ACE_Asynch_Read_Dgram factory.

Definition at line 3190 of file WIN32_Asynch_IO.cpp.

References ACE_ASSERT, ACE_NEW, addr_len_, ACE_Addr::get_size, and remote_address_.

03200   : ACE_Asynch_Result_Impl (),
03201     ACE_Asynch_Read_Dgram_Result_Impl(),
03202     ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority, signal_number),
03203     bytes_to_read_ (bytes_to_read),
03204     message_block_ (message_block),
03205     remote_address_ (0),
03206     addr_len_ (0),
03207     flags_ (flags),
03208     handle_ (handle)
03209 {
03210   ACE_ASSERT (protocol_family == PF_INET); // only supporting INET addresses
03211 
03212   ACE_NEW (remote_address_, ACE_INET_Addr);
03213   addr_len_ = remote_address_->get_size ();
03214 
03215   ACE_UNUSED_ARG (protocol_family);
03216 }

ACE_WIN32_Asynch_Read_Dgram_Result::~ACE_WIN32_Asynch_Read_Dgram_Result void    [protected, virtual]
 

Destructor.

Definition at line 3255 of file WIN32_Asynch_IO.cpp.

References remote_address_.

03256 {
03257   delete this->remote_address_;
03258 }


Member Function Documentation

const void * ACE_WIN32_Asynch_Read_Dgram_Result::act void    const [virtual]
 

ACT associated with the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3131 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::act.

03132 {
03133   return ACE_WIN32_Asynch_Result::act ();
03134 }

size_t ACE_WIN32_Asynch_Read_Dgram_Result::bytes_to_read void    const [virtual]
 

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

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 3077 of file WIN32_Asynch_IO.cpp.

References bytes_to_read_.

03078 {
03079   return this->bytes_to_read_;
03080 }

size_t ACE_WIN32_Asynch_Read_Dgram_Result::bytes_transferred void    const [virtual]
 

Number of bytes transferred by the operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3125 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::bytes_transferred.

Referenced by complete.

03126 {
03127   return ACE_WIN32_Asynch_Result::bytes_transferred ();
03128 }

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

Proactor will call this method when the read completes.

Implements ACE_Asynch_Result_Impl.

Definition at line 3219 of file WIN32_Asynch_IO.cpp.

References bytes_transferred, ACE_WIN32_Asynch_Result::bytes_transferred_, completion_key, ACE_WIN32_Asynch_Result::completion_key_, ACE_Message_Block::cont, error, ACE_WIN32_Asynch_Result::error_, ACE_Handler::handle_read_dgram, ACE_WIN32_Asynch_Result::handler_, message_block_, remote_address_, ACE_Addr::set_size, ACE_Message_Block::space, success, ACE_WIN32_Asynch_Result::success_, and ACE_Message_Block::wr_ptr.

03223 {
03224   // Copy the data which was returned by GetQueuedCompletionStatus
03225   this->bytes_transferred_ = bytes_transferred;
03226   this->success_ = success;
03227   this->completion_key_ = completion_key;
03228   this->error_ = error;
03229 
03230   // Appropriately move the pointers in the message block.
03231   for (ACE_Message_Block* mb = this->message_block_;
03232        (mb != 0) && (bytes_transferred > 0);
03233        mb = mb->cont ())
03234     {
03235       size_t len_part = mb->space ();
03236 
03237       if ( len_part > bytes_transferred)
03238         len_part = bytes_transferred;
03239 
03240       mb->wr_ptr (len_part);
03241 
03242       bytes_transferred -= len_part;
03243     }
03244 
03245   // Adjust the address length
03246   this->remote_address_->set_size (this->addr_len_);
03247 
03248   // Create the interface result class.
03249   ACE_Asynch_Read_Dgram::Result result (this);
03250 
03251   // Call the application handler.
03252   this->handler_.handle_read_dgram (result);
03253 }

const void * ACE_WIN32_Asynch_Read_Dgram_Result::completion_key void    const [virtual]
 

This returns the ACT associated with the handle when it was registered with the I/O completion port. This ACT is not the same as the ACT associated with the asynchronous operation.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3143 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::completion_key.

Referenced by complete.

03144 {
03145   return ACE_WIN32_Asynch_Result::completion_key ();
03146 }

u_long ACE_WIN32_Asynch_Read_Dgram_Result::error void    const [virtual]
 

Error value if the operation fail.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3149 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::error.

Referenced by complete.

03150 {
03151   return ACE_WIN32_Asynch_Result::error ();
03152 }

ACE_HANDLE ACE_WIN32_Asynch_Read_Dgram_Result::event void    const [virtual]
 

Event associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3155 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::event.

03156 {
03157   return ACE_WIN32_Asynch_Result::event ();
03158 }

int ACE_WIN32_Asynch_Read_Dgram_Result::flags void    const [virtual]
 

The flags used in the read.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 3113 of file WIN32_Asynch_IO.cpp.

References flags_.

03114 {
03115   return this->flags_;
03116 }

ACE_HANDLE ACE_WIN32_Asynch_Read_Dgram_Result::handle void    const [virtual]
 

I/O handle used for reading.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 3119 of file WIN32_Asynch_IO.cpp.

References handle_.

Referenced by ACE_WIN32_Asynch_Read_Dgram::recv.

03120 {
03121   return this->handle_;
03122 }

ACE_Message_Block * ACE_WIN32_Asynch_Read_Dgram_Result::message_block void    const [virtual]
 

Message block which contains the read data.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 3083 of file WIN32_Asynch_IO.cpp.

References message_block_.

03084 {
03085   return this->message_block_;
03086 }

u_long ACE_WIN32_Asynch_Read_Dgram_Result::offset void    const [virtual]
 

This really make sense only when doing file I/O.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3161 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset.

03162 {
03163   return ACE_WIN32_Asynch_Result::offset ();
03164 }

u_long ACE_WIN32_Asynch_Read_Dgram_Result::offset_high void    const [virtual]
 

Offset_high associated with the OVERLAPPED structure.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3167 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::offset_high.

03168 {
03169   return ACE_WIN32_Asynch_Result::offset_high ();
03170 }

int ACE_WIN32_Asynch_Read_Dgram_Result::post_completion ACE_Proactor_Impl   proactor [virtual]
 

Post <this> to the Proactor's completion port.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3185 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::post_completion.

03186 {
03187   return ACE_WIN32_Asynch_Result::post_completion (proactor);
03188 }

int ACE_WIN32_Asynch_Read_Dgram_Result::priority void    const [virtual]
 

The priority of the asynchronous operation. Currently, this is not supported on Win32.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3173 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::priority.

03174 {
03175   return ACE_WIN32_Asynch_Result::priority ();
03176 }

int ACE_WIN32_Asynch_Read_Dgram_Result::remote_address ACE_Addr   addr const [virtual]
 

The address of where the packet came from.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 3090 of file WIN32_Asynch_IO.cpp.

References ACE_Addr::get_size, ACE_Addr::get_type, remote_address_, and ACE_Addr::set_addr.

03091 {
03092  int retVal = -1;  // failure
03093 
03094   // make sure the addresses are of the same type
03095   if (addr.get_type () == this->remote_address_->get_type ())
03096   { // copy the remote_address_ into addr
03097     addr.set_addr (this->remote_address_->get_addr (),
03098                    this->remote_address_->get_size ());
03099     retVal = 0; // success
03100   }
03101 
03102   return retVal;
03103 }

sockaddr * ACE_WIN32_Asynch_Read_Dgram_Result::saddr   const
 

Definition at line 3106 of file WIN32_Asynch_IO.cpp.

References ACE_Addr::get_addr, and remote_address_.

Referenced by ACE_WIN32_Asynch_Read_Dgram::recv.

03107 {
03108   return (sockaddr *) this->remote_address_->get_addr ();
03109 }

int ACE_WIN32_Asynch_Read_Dgram_Result::signal_number void    const [virtual]
 

No-op. Returns 0.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3179 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::signal_number.

03180 {
03181   return ACE_WIN32_Asynch_Result::signal_number ();
03182 }

int ACE_WIN32_Asynch_Read_Dgram_Result::success void    const [virtual]
 

Did the operation succeed?

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 3137 of file WIN32_Asynch_IO.cpp.

References ACE_WIN32_Asynch_Result::success.

Referenced by complete.

03138 {
03139   return ACE_WIN32_Asynch_Result::success ();
03140 }


Friends And Related Function Documentation

friend class ACE_WIN32_Asynch_Read_Dgram [friend]
 

Factory class will have special permissions.

Definition at line 1573 of file WIN32_Asynch_IO.h.

friend class ACE_WIN32_Proactor [friend]
 

Proactor class has special permission.

Reimplemented from ACE_WIN32_Asynch_Result.

Definition at line 1576 of file WIN32_Asynch_IO.h.


Member Data Documentation

int ACE_WIN32_Asynch_Read_Dgram_Result::addr_len_ [protected]
 

Definition at line 1670 of file WIN32_Asynch_IO.h.

Referenced by ACE_WIN32_Asynch_Read_Dgram_Result, and ACE_WIN32_Asynch_Read_Dgram::recv.

size_t ACE_WIN32_Asynch_Read_Dgram_Result::bytes_to_read_ [protected]
 

Bytes requested when the asynchronous read was initiated.

Definition at line 1662 of file WIN32_Asynch_IO.h.

Referenced by bytes_to_read.

int ACE_WIN32_Asynch_Read_Dgram_Result::flags_ [protected]
 

The flags used in the read.

Definition at line 1673 of file WIN32_Asynch_IO.h.

Referenced by flags, and ACE_WIN32_Asynch_Read_Dgram::recv.

ACE_HANDLE ACE_WIN32_Asynch_Read_Dgram_Result::handle_ [protected]
 

I/O handle used for reading.

Definition at line 1676 of file WIN32_Asynch_IO.h.

Referenced by handle.

ACE_Message_Block* ACE_WIN32_Asynch_Read_Dgram_Result::message_block_ [protected]
 

Message block for reading the data into.

Definition at line 1665 of file WIN32_Asynch_IO.h.

Referenced by complete, and message_block.

ACE_Addr* ACE_WIN32_Asynch_Read_Dgram_Result::remote_address_ [protected]
 

The address of where the packet came from.

Definition at line 1668 of file WIN32_Asynch_IO.h.

Referenced by ACE_WIN32_Asynch_Read_Dgram_Result, complete, remote_address, saddr, and ~ACE_WIN32_Asynch_Read_Dgram_Result.


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