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

ACE_POSIX_Asynch_Read_Dgram_Result Class Reference

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

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Read_Dgram_Result:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_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 (void) const
int flags (void) const
 The flags used in the read. More...

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


Protected Methods

 ACE_POSIX_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_POSIX_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_POSIX_Asynch_Read_Dgram
 Factory classes will have special permissions. More...

class ACE_POSIX_Proactor
 Proactor class has special permission. More...


Detailed Description

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

Definition at line 1228 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Read_Dgram_Result::ACE_POSIX_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 2358 of file POSIX_Asynch_IO.cpp.

References ACE_NEW.

02369   : ACE_Asynch_Result_Impl (),
02370     ACE_Asynch_Read_Dgram_Result_Impl(),
02371     ACE_POSIX_Asynch_Result (handler, act, event, 0, 0, priority, signal_number),
02372     bytes_to_read_ (bytes_to_read),
02373     message_block_ (message_block),
02374     remote_address_ (0),
02375     addr_len_ (0),
02376     flags_ (flags),
02377     handle_ (handle)
02378 {
02379   ACE_UNUSED_ARG (protocol_family);
02380   this->aio_fildes = handle;
02381   this->aio_nbytes = bytes_to_read;
02382   ACE_NEW (this->remote_address_, ACE_INET_Addr);
02383 }

ACE_POSIX_Asynch_Read_Dgram_Result::~ACE_POSIX_Asynch_Read_Dgram_Result void    [protected, virtual]
 

Destructor.

Definition at line 2409 of file POSIX_Asynch_IO.cpp.

References remote_address_.

02410 {
02411   delete this->remote_address_;
02412 }


Member Function Documentation

size_t ACE_POSIX_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 2311 of file POSIX_Asynch_IO.cpp.

References bytes_to_read_.

02312 {
02313   return this->bytes_to_read_;
02314 }

void ACE_POSIX_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 2386 of file POSIX_Asynch_IO.cpp.

References ACE_POSIX_Asynch_Result::bytes_transferred, ACE_POSIX_Asynch_Result::bytes_transferred_, ACE_POSIX_Asynch_Result::completion_key, ACE_POSIX_Asynch_Result::completion_key_, ACE_POSIX_Asynch_Result::error, ACE_POSIX_Asynch_Result::error_, ACE_Handler::handle_read_dgram, ACE_POSIX_Asynch_Result::handler_, remote_address_, ACE_Addr::set_size, ACE_POSIX_Asynch_Result::success, and ACE_POSIX_Asynch_Result::success_.

02390 {
02391   // Copy the data which was returned by GetQueuedCompletionStatus
02392   this->bytes_transferred_ = bytes_transferred;
02393   this->success_ = success;
02394   this->completion_key_ = completion_key;
02395   this->error_ = error;
02396 
02397   // <errno> is available in the aiocb.
02398   ACE_UNUSED_ARG (error);
02399 
02400  this->remote_address_->set_size(this->addr_len_);
02401 
02402   // Create the interface result class.
02403   ACE_Asynch_Read_Dgram::Result result (this);
02404 
02405   // Call the application handler.
02406   this->handler_.handle_read_dgram (result);
02407 }

int ACE_POSIX_Asynch_Read_Dgram_Result::flags void    const [virtual]
 

The flags used in the read.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 2340 of file POSIX_Asynch_IO.cpp.

References flags_.

02341 {
02342   return this->flags_;
02343 }

ACE_HANDLE ACE_POSIX_Asynch_Read_Dgram_Result::handle void    const [virtual]
 

I/O handle used for reading.

Implements ACE_Asynch_Read_Dgram_Result_Impl.

Definition at line 2346 of file POSIX_Asynch_IO.cpp.

References handle_.

02347 {
02348   return this->handle_;
02349 }

ACE_Message_Block * ACE_POSIX_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 2352 of file POSIX_Asynch_IO.cpp.

References message_block_.

02353 {
02354   return this->message_block_;
02355 }

int ACE_POSIX_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 2317 of file POSIX_Asynch_IO.cpp.

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

02318 {
02319   int retVal = -1;  // failure
02320 
02321   // make sure the addresses are of the same type
02322   if (addr.get_type () == this->remote_address_->get_type ())
02323   { // copy the remote_address_ into addr
02324     addr.set_addr (this->remote_address_->get_addr (),
02325                    this->remote_address_->get_size ());
02326     retVal = 0; // success
02327   }
02328 
02329   return retVal;
02330 }

sockaddr * ACE_POSIX_Asynch_Read_Dgram_Result::saddr void    const
 

Definition at line 2333 of file POSIX_Asynch_IO.cpp.

References ACE_Addr::get_addr, and remote_address_.

02334 {
02335   return (sockaddr *) this->remote_address_->get_addr ();
02336 }


Friends And Related Function Documentation

friend class ACE_POSIX_Asynch_Read_Dgram [friend]
 

Factory classes will have special permissions.

Definition at line 1233 of file POSIX_Asynch_IO.h.

friend class ACE_POSIX_Proactor [friend]
 

Proactor class has special permission.

Definition at line 1236 of file POSIX_Asynch_IO.h.


Member Data Documentation

int ACE_POSIX_Asynch_Read_Dgram_Result::addr_len_ [protected]
 

Definition at line 1289 of file POSIX_Asynch_IO.h.

size_t ACE_POSIX_Asynch_Read_Dgram_Result::bytes_to_read_ [protected]
 

Bytes requested when the asynchronous read was initiated.

Definition at line 1281 of file POSIX_Asynch_IO.h.

Referenced by bytes_to_read.

int ACE_POSIX_Asynch_Read_Dgram_Result::flags_ [protected]
 

The flags used in the read.

Definition at line 1292 of file POSIX_Asynch_IO.h.

Referenced by flags.

ACE_HANDLE ACE_POSIX_Asynch_Read_Dgram_Result::handle_ [protected]
 

I/O handle used for reading.

Definition at line 1295 of file POSIX_Asynch_IO.h.

Referenced by handle.

ACE_Message_Block* ACE_POSIX_Asynch_Read_Dgram_Result::message_block_ [protected]
 

Message block for reading the data into.

Definition at line 1284 of file POSIX_Asynch_IO.h.

Referenced by message_block.

ACE_Addr* ACE_POSIX_Asynch_Read_Dgram_Result::remote_address_ [protected]
 

The address of where the packet came from.

Definition at line 1287 of file POSIX_Asynch_IO.h.

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


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