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

ACE_POSIX_Asynch_Write_Stream Class Reference

This class implements <ACE_Asynch_Write_Stream> for all POSIX implementations of ACE_Proactor. More...

#include <POSIX_Asynch_IO.h>

Inheritance diagram for ACE_POSIX_Asynch_Write_Stream:

Inheritance graph
[legend]
Collaboration diagram for ACE_POSIX_Asynch_Write_Stream:

Collaboration graph
[legend]
List of all members.

Public Methods

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

int write (ACE_Message_Block &message_block, size_t bytes_to_write, const void *act, int priority, int signal_number=0)
 This starts off an asynchronous write. Upto <bytes_to_write> will be written from the <message_block>. More...

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


Detailed Description

This class implements <ACE_Asynch_Write_Stream> for all POSIX implementations of ACE_Proactor.

Definition at line 368 of file POSIX_Asynch_IO.h.


Constructor & Destructor Documentation

ACE_POSIX_Asynch_Write_Stream::ACE_POSIX_Asynch_Write_Stream ACE_POSIX_Proactor   posix_proactor
 

Constructor.

Definition at line 403 of file POSIX_Asynch_IO.cpp.

00404   : ACE_Asynch_Operation_Impl (),
00405     ACE_Asynch_Write_Stream_Impl (),
00406     ACE_POSIX_Asynch_Operation (posix_proactor)
00407 {
00408 }

ACE_POSIX_Asynch_Write_Stream::~ACE_POSIX_Asynch_Write_Stream void    [virtual]
 

Destructor.

Definition at line 448 of file POSIX_Asynch_IO.cpp.

00449 {
00450 }


Member Function Documentation

int ACE_POSIX_Asynch_Write_Stream::write ACE_Message_Block   message_block,
size_t    bytes_to_write,
const void *    act,
int    priority,
int    signal_number = 0
[virtual]
 

This starts off an asynchronous write. Upto <bytes_to_write> will be written from the <message_block>.

Implements ACE_Asynch_Write_Stream_Impl.

Reimplemented in ACE_POSIX_Asynch_Write_File.

Definition at line 411 of file POSIX_Asynch_IO.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_NEW_RETURN, ACE_POSIX_Proactor::get_handle, ACE_Message_Block::length, LM_ERROR, ACE_POSIX_Asynch_Operation::posix_proactor, ACE_POSIX_Asynch_Operation::proactor, ACE_POSIX_Proactor::start_aio, and ACE_POSIX_Proactor::WRITE.

Referenced by ACE_POSIX_Asynch_Transmit_Handler::handle_read_file, ACE_POSIX_Asynch_Transmit_Handler::handle_write_stream, ACE_POSIX_Asynch_Transmit_Handler::initiate_read_file, ACE_POSIX_Asynch_Transmit_Handler::transmit, and ACE_POSIX_Asynch_Write_File::write.

00416 {
00417   size_t len = message_block.length ();
00418   if (bytes_to_write > len)
00419      bytes_to_write = len;
00420 
00421   if (bytes_to_write == 0)
00422     ACE_ERROR_RETURN 
00423       ((LM_ERROR,
00424         ACE_LIB_TEXT ("ACE_POSIX_Asynch_Write_Stream::write:")
00425         ACE_LIB_TEXT ("Attempt to write 0 bytes\n")),
00426       -1);
00427 
00428   ACE_POSIX_Asynch_Write_Stream_Result *result = 0;
00429   ACE_POSIX_Proactor *proactor = this->posix_proactor ();
00430   ACE_NEW_RETURN (result,
00431                   ACE_POSIX_Asynch_Write_Stream_Result (*this->handler_,
00432                                                         this->handle_,
00433                                                         message_block,
00434                                                         bytes_to_write,
00435                                                         act,
00436                                                         proactor->get_handle (),
00437                                                         priority,
00438                                                         signal_number),
00439                   -1);
00440 
00441   int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::WRITE);
00442   if (return_val == -1)
00443     delete result;
00444 
00445   return return_val;
00446 }


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