ACE_POSIX_Asynch_Read_Dgram Class Reference

This class is a factory for starting off asynchronous reads on a UDP socket. More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Read_Dgram:

Inheritance graph
Collaboration diagram for ACE_POSIX_Asynch_Read_Dgram:

Collaboration graph
List of all members.

Public Member Functions

 ACE_POSIX_Asynch_Read_Dgram (ACE_POSIX_Proactor *posix_proactor)

virtual ~ACE_POSIX_Asynch_Read_Dgram (void)
virtual ssize_t recv (ACE_Message_Block *message_block, size_t &number_of_bytes_recvd, int flags, int protocol_family, const void *act, int priority, int signal_number)

Protected Member Functions

 ACE_POSIX_Asynch_Read_Dgram (void)
 Do-nothing constructor.

Detailed Description

This class is a factory for starting off asynchronous reads on a UDP socket.

Once is called, multiple asynchronous s can be started using this class. An ACE_Asynch_Read_Dgram::Result will be passed back to the when the asynchronous reads completes through the <ACE_Handler::handle_read_stream> callback.

Definition at line 1054 of file POSIX_Asynch_IO.h.

Constructor & Destructor Documentation

ACE_POSIX_Asynch_Read_Dgram::ACE_POSIX_Asynch_Read_Dgram ACE_POSIX_Proactor posix_proactor  ) 


Definition at line 2359 of file POSIX_Asynch_IO.cpp.

02360   : ACE_POSIX_Asynch_Operation (posix_proactor)
02361 {
02362 }

ACE_POSIX_Asynch_Read_Dgram::~ACE_POSIX_Asynch_Read_Dgram void   )  [virtual]

Definition at line 2322 of file POSIX_Asynch_IO.cpp.

02323 {
02324 }

ACE_POSIX_Asynch_Read_Dgram::ACE_POSIX_Asynch_Read_Dgram void   )  [protected]

Do-nothing constructor.

Member Function Documentation

ssize_t ACE_POSIX_Asynch_Read_Dgram::recv ACE_Message_Block message_block,
size_t &  number_of_bytes_recvd,
int  flags,
int  protocol_family,
const void *  act,
int  priority,
int  signal_number

This method queues an asynchronous read. Up to message_block->total_size() bytes will be read and stored in the message_block beginning at its write pointer. The message_block write pointer will be updated to reflect any added bytes if the read operation is successful completed. Priority of the operation is specified by . On POSIX4-Unix, this is supported. Works like in Unix. Negative values are not allowed. 0 means priority of the operation same as the process priority. 1 means priority of the operation is one less than process. argument is a no-op on non-POSIX4 systems.

Unlike the Windows version of this facility, no indication of immediate success can be returned, and number_of_bytes_read is never used.
  • flags Not used.
  • protocol_family Not used.
    Return values:
    0 The IO will complete asynchronously.
    -1 There was an error; see errno to get the error code.

Implements ACE_Asynch_Read_Dgram_Impl.

Definition at line 2327 of file POSIX_Asynch_IO.cpp.

References ACE_NEW_RETURN, ACE_POSIX_Proactor::get_handle(), ACE_POSIX_Asynch_Operation::posix_proactor(), ACE_Message_Block::space(), and ACE_POSIX_Proactor::start_aio().

02334 {
02335   size_t space = message_block->space ();
02336   // Create the Asynch_Result.
02337   ACE_POSIX_Asynch_Read_Dgram_Result *result = 0;
02338   ACE_POSIX_Proactor *proactor = this->posix_proactor ();
02339   ACE_NEW_RETURN (result,
02340                   ACE_POSIX_Asynch_Read_Dgram_Result (this->handler_proxy_,
02341                                                       this->handle_,
02342                                                       message_block,
02343                                                       space,
02344                                                       flags,
02345                                                       protocol_family,
02346                                                       act,
02347                                                       proactor->get_handle (),
02348                                                       priority,
02349                                                       signal_number),
02350                   -1);
02352   int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::ACE_OPCODE_READ);
02353   if (return_val == -1)
02354     delete result;
02356   return return_val;
02357 }

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