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

Asynch_IO_Impl.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Asynch_IO_Impl.h
00006  *
00007  *  $Id: Asynch_IO_Impl.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *
00010  *  This class contains asbtract base classes for all the concrete
00011  *  implementation classes for the various asynchronous operations
00012  *  that are used with the Praoctor.
00013  *
00014  *
00015  *  @author Irfan Pyarali (irfan@cs.wustl.edu)
00016  *  @author Tim Harrison (harrison@cs.wustl.edu)
00017  *  @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
00018  *  @author Roger Tragin <r.tragin@computer.org>
00019  *  @author Alexander Libman <alibman@ihug.com.au>
00020  */
00021 //=============================================================================
00022 
00023 #ifndef ACE_ASYNCH_IO_IMPL_H
00024 #define ACE_ASYNCH_IO_IMPL_H
00025 #include "ace/pre.h"
00026 
00027 #include "ace/config-all.h"
00028 
00029 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00030 #pragma once
00031 #endif /* ACE_LACKS_PRAGMA_ONCE */
00032 
00033 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))
00034 // This only works on Win32 platforms and on Unix platforms supporting
00035 // aio calls.
00036 
00037 #include "ace/Asynch_IO.h"
00038 
00039 // Forward declaration.
00040 class ACE_Proactor_Impl;
00041 
00042 /**
00043  * @class ACE_Asynch_Result_Impl
00044  *
00045  * @brief Abstract base class for the all the classes that provide
00046  * concrete implementations for ACE_Asynch_Result.
00047  *
00048  */
00049 class ACE_Export ACE_Asynch_Result_Impl
00050 {
00051 public:
00052   virtual ~ACE_Asynch_Result_Impl (void);
00053 
00054   /// Number of bytes transferred by the operation.
00055   virtual size_t bytes_transferred (void) const = 0;
00056 
00057   /// ACT associated with the operation.
00058   virtual const void *act (void) const = 0;
00059 
00060   /// Did the operation succeed?
00061   virtual int success (void) const = 0;
00062 
00063   /// This ACT is not the same as the ACT associated with the
00064   /// asynchronous operation.
00065   virtual const void *completion_key (void) const = 0;
00066 
00067   /// Error value if the operation fail.
00068   virtual u_long error (void) const = 0;
00069 
00070   /// Event associated with the OVERLAPPED structure.
00071   virtual ACE_HANDLE event (void) const = 0;
00072 
00073   /// This really make sense only when doing file I/O.
00074   virtual u_long offset (void) const = 0;
00075   virtual u_long offset_high (void) const = 0;
00076 
00077   /// Priority of the operation.
00078   virtual int priority (void) const = 0;
00079 
00080   /**
00081    * POSIX4 real-time signal number to be used for the
00082    * operation. <signal_number> ranges from SIGRTMIN to SIGRTMAX. By
00083    * default, SIGRTMIN is used to issue <aio_> calls. This is a no-op
00084    * on non-POSIX4 systems and returns 0.
00085    */
00086   virtual int signal_number (void) const = 0;
00087 
00088   // protected:
00089   //
00090   // These two should really be protected.  But sometimes it
00091   // simplifies code to be able to "fake" a result.  Use carefully.
00092   /// This is called when the asynchronous operation completes.
00093   virtual void complete (size_t bytes_transferred,
00094                          int success,
00095                          const void *completion_key,
00096                          u_long error = 0) = 0;
00097 
00098   /// Post <this> to the Proactor's completion port.
00099   virtual int post_completion (ACE_Proactor_Impl *proactor) = 0;
00100 
00101 protected:
00102   /// Do-nothing constructor.
00103   ACE_Asynch_Result_Impl (void);
00104 };
00105 
00106 /**
00107  * @class ACE_Asynch_Operation_Impl
00108  *
00109  * @brief Abstract base class for all the concrete implementation
00110  * classes that provide different implementations for the
00111  * ACE_Asynch_Operation.
00112  */
00113 class ACE_Export ACE_Asynch_Operation_Impl
00114 {
00115 public:
00116   virtual ~ACE_Asynch_Operation_Impl (void);
00117 
00118   /**
00119    * Initializes the factory with information which will be used with
00120    * each asynchronous call.  If (<handle> == ACE_INVALID_HANDLE),
00121    * <ACE_Handler::handle> will be called on the <handler> to get the
00122    * correct handle.
00123    */
00124   virtual int open (ACE_Handler &handler,
00125                     ACE_HANDLE handle,
00126                     const void *completion_key,
00127                     ACE_Proactor *proactor) = 0;
00128 
00129   /**
00130    * This cancels all pending accepts operations that were issued by
00131    * the calling thread.  The function does not cancel asynchronous
00132    * operations issued by other threads.
00133    */
00134   virtual int cancel (void) = 0;
00135 
00136   // = Access methods.
00137 
00138   /// Return the underlying proactor.
00139   virtual ACE_Proactor* proactor (void) const = 0;
00140 
00141 protected:
00142   /// Do-nothing constructor.
00143   ACE_Asynch_Operation_Impl (void);
00144 };
00145 
00146 /**
00147  * @class ACE_Asynch_Read_Stream_Impl
00148  *
00149  * @brief Abstract base class for all the concrete implementation
00150  * classes that provide different implementations for the
00151  * ACE_Asynch_Read_Stream
00152  *
00153  */
00154 class ACE_Export ACE_Asynch_Read_Stream_Impl : public virtual ACE_Asynch_Operation_Impl
00155 {
00156 public:
00157   virtual ~ACE_Asynch_Read_Stream_Impl (void);
00158 
00159   /// This starts off an asynchronous read. Upto <bytes_to_read> will
00160   /// be read and stored in the <message_block>.
00161   virtual int read (ACE_Message_Block &message_block,
00162                     size_t bytes_to_read,
00163                     const void *act,
00164                     int priority,
00165                     int signal_number) = 0;
00166 
00167 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00168   /**
00169   * Same as above but with scatter support, through chaining of composite
00170   * message blocks using the continuation field.
00171   */
00172   virtual int readv (ACE_Message_Block &message_block,
00173                      size_t bytes_to_read,
00174                      const void *act,
00175                      int priority,
00176                      int signal_number) = 0;
00177 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00178 
00179 protected:
00180   /// Do-nothing constructor.
00181   ACE_Asynch_Read_Stream_Impl (void);
00182 };
00183 
00184 /**
00185  * @class ACE_Asynch_Read_Stream_Result_Impl
00186  *
00187  * @brief Abstract base class for all the concrete implementation
00188  * classes that provide different implementations for the
00189  * ACE_Asynch_Read_Stream::Result class.
00190  *
00191  */
00192 class ACE_Export ACE_Asynch_Read_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl
00193 {
00194 public:
00195   virtual ~ACE_Asynch_Read_Stream_Result_Impl (void);
00196 
00197   /// The number of bytes which were requested at the start of the
00198   /// asynchronous read.
00199   virtual size_t bytes_to_read (void) const = 0;
00200 
00201   /// Message block which contains the read data.
00202   virtual ACE_Message_Block &message_block (void) const = 0;
00203 
00204   /// I/O handle used for reading.
00205   virtual ACE_HANDLE handle (void) const = 0;
00206 
00207 protected:
00208   /// Do-nothing constructor.
00209   ACE_Asynch_Read_Stream_Result_Impl (void);
00210 };
00211 
00212 /**
00213  * @class ACE_Asynch_Write_Stream_Impl
00214  *
00215  * @brief Abstract base class for all the concrete implementation
00216  * classes that provide different implementations for the
00217  * ACE_Asynch_Write_Stream class.
00218  *
00219  */
00220 class ACE_Export ACE_Asynch_Write_Stream_Impl : public virtual ACE_Asynch_Operation_Impl
00221 {
00222 public:
00223   virtual ~ACE_Asynch_Write_Stream_Impl (void);
00224 
00225   /// This starts off an asynchronous write.  Upto <bytes_to_write>
00226   /// will be written from the <message_block>.
00227   virtual int write (ACE_Message_Block &message_block,
00228                      size_t bytes_to_write,
00229                      const void *act,
00230                      int priority,
00231                      int signal_number) = 0;
00232 
00233 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00234   /**
00235   * Same as above but with gather support, through chaining of composite
00236   * message blocks using the continuation field.
00237   */
00238   virtual int writev (ACE_Message_Block &message_block,
00239                       size_t bytes_to_write,
00240                       const void *act,
00241                       int priority,
00242                       int signal_number) = 0;
00243 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00244   
00245 protected:
00246   /// Do-nothing constructor.
00247   ACE_Asynch_Write_Stream_Impl (void);
00248 };
00249 
00250 /**
00251  * @class ACE_Asynch_Write_Stream_Result_Impl
00252  *
00253  * @brief Abstract base class for all the concrete implementation
00254  * classes that provide different implementations for the
00255  * ACE_Asynch_Write_Stream::Result.
00256  *
00257  */
00258 class ACE_Export ACE_Asynch_Write_Stream_Result_Impl : public virtual ACE_Asynch_Result_Impl
00259 {
00260 public:
00261   virtual ~ACE_Asynch_Write_Stream_Result_Impl (void);
00262 
00263   /// The number of bytes which were requested at the start of the
00264   /// asynchronous write.
00265   virtual size_t bytes_to_write (void) const = 0;
00266 
00267   /// Message block that contains the data to be written.
00268   virtual ACE_Message_Block &message_block (void) const = 0;
00269 
00270   /// I/O handle used for writing.
00271   virtual ACE_HANDLE handle (void) const = 0;
00272 
00273 protected:
00274   /// Do-nothing constructor.
00275   ACE_Asynch_Write_Stream_Result_Impl (void);
00276 };
00277 
00278 /**
00279  * @class ACE_Asynch_Read_File_Impl
00280  *
00281  * @brief Abstract base class for all the concrete implementation
00282  * classes that provide different implementations for the
00283  * ACE_Asynch_Read_File::Result.
00284  *
00285  */
00286 class ACE_Export ACE_Asynch_Read_File_Impl : public virtual ACE_Asynch_Read_Stream_Impl
00287 {
00288 public:
00289   virtual ~ACE_Asynch_Read_File_Impl (void);
00290 
00291   /**
00292    * This starts off an asynchronous read.  Upto <bytes_to_read> will
00293    * be read and stored in the <message_block>.  The read will start
00294    * at <offset> from the beginning of the file.
00295    */
00296   virtual int read (ACE_Message_Block &message_block,
00297                     size_t bytes_to_read,
00298                     u_long offset,
00299                     u_long offset_high,
00300                     const void *act,
00301                     int priority,
00302                     int signal_number) = 0;
00303 
00304 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00305   /**
00306   * Same as above but with scatter support, through chaining of composite
00307   * message blocks using the continuation field.
00308   * NOTE: In win32 Each data block payload must be at least the size of a system 
00309   * memory page and must be aligned on a system memory page size boundary
00310   */
00311   virtual int readv (ACE_Message_Block &message_block,
00312                      size_t bytes_to_read,
00313                      u_long offset,
00314                      u_long offset_high,
00315                      const void *act,
00316                      int priority,
00317                      int signal_number) = 0;
00318 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00319 
00320   // We don;t need to redefine the following function again because it
00321   // has already been defined in ACE_Asynch_Read_Stream_Impl.  But we
00322   // still need it here to supress a overwriting pure virtual function
00323   // warning in KAI compiler.
00324   /// This starts off an asynchronous read. Upto <bytes_to_read> will
00325   /// be read and stored in the <message_block>.
00326   virtual int read (ACE_Message_Block &message_block,
00327                     size_t bytes_to_read,
00328                     const void *act,
00329                     int priority,
00330                     int signal_number) = 0;
00331 
00332 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00333   /**
00334   * Same as above but with scatter support, through chaining of composite
00335   * message blocks using the continuation field.
00336   */
00337   virtual int readv (ACE_Message_Block &message_block,
00338                      size_t bytes_to_read,
00339                      const void *act,
00340                      int priority,
00341                      int signal_number) = 0;
00342 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00343 
00344 protected:
00345   /// Do-nothing constructor.
00346   ACE_Asynch_Read_File_Impl (void);
00347 };
00348 
00349 /**
00350  * @class ACE_Asynch_Read_File_Result_Impl
00351  *
00352  * @brief This is the abstract base class for all the concrete
00353  * implementation classes for ACE_Asynch_Read_File::Result.
00354  *
00355  */
00356 class ACE_Export ACE_Asynch_Read_File_Result_Impl : public virtual ACE_Asynch_Read_Stream_Result_Impl
00357 {
00358 public:
00359   /// Destructor.
00360   virtual ~ACE_Asynch_Read_File_Result_Impl (void);
00361 
00362 protected:
00363   /// Do-nothing constructor.
00364   ACE_Asynch_Read_File_Result_Impl (void);
00365 };
00366 
00367 /**
00368  * @class ACE_Asynch_Write_File_Impl
00369  *
00370  * @brief Abstract base class for all the concrete implementation
00371  * classes that provide different implementations for the
00372  * ACE_Asynch_Write_File.
00373  *
00374  */
00375 class ACE_Export ACE_Asynch_Write_File_Impl : public virtual ACE_Asynch_Write_Stream_Impl
00376 {
00377 public:
00378   virtual ~ACE_Asynch_Write_File_Impl (void);
00379 
00380   /**
00381    * This starts off an asynchronous write.  Upto <bytes_to_write>
00382    * will be write and stored in the <message_block>.  The write will
00383    * start at <offset> from the beginning of the file.
00384    */
00385   virtual int write (ACE_Message_Block &message_block,
00386                      size_t bytes_to_write,
00387                      u_long offset,
00388                      u_long offset_high,
00389                      const void *act,
00390                      int priority,
00391                      int signal_number) = 0;
00392 
00393 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00394   /**
00395   * Same as above but with gather support, through chaining of composite
00396   * message blocks using the continuation field.
00397   * NOTE: In win32 Each data block payload must be at least the size of a system 
00398   * memory page and must be aligned on a system memory page size boundary
00399   */
00400   virtual int writev (ACE_Message_Block &message_block,
00401                       size_t bytes_to_write,
00402                       u_long offset,
00403                       u_long offset_high,
00404                       const void *act,
00405                       int priority,
00406                       int signal_number) = 0;
00407 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00408 
00409 
00410   // We don;t need to redefine the following function again because it
00411   // has already been defined in ACE_Asynch_Write_Stream_Impl.  But we
00412   // still need it here to supress a overwriting pure virtual function
00413   // warning in KAI compiler.
00414   /// This starts off an asynchronous write.  Upto <bytes_to_write>
00415   /// will be written from the <message_block>.
00416   virtual int write (ACE_Message_Block &message_block,
00417                      size_t bytes_to_write,
00418                      const void *act,
00419                      int priority,
00420                      int signal_number) = 0;
00421 
00422 #if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
00423   /**
00424   * Same as above but with gather support, through chaining of composite
00425   * message blocks using the continuation field.
00426   */
00427   virtual int writev (ACE_Message_Block &message_block,
00428                       size_t bytes_to_write,
00429                       const void *act,
00430                       int priority,
00431                       int signal_number) = 0;
00432 #endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */
00433 
00434 protected:
00435   /// Do-nothing constructor.
00436   ACE_Asynch_Write_File_Impl (void);
00437 };
00438 
00439 /**
00440  * @class ACE_Asynch_Write_File_Result_Impl
00441  *
00442  * @brief This is the abstract base class for all the concrete
00443  * implementation classes that provide different implementations
00444  * for the ACE_Asynch_Write_File::Result.
00445  *
00446  */
00447 class ACE_Export ACE_Asynch_Write_File_Result_Impl : public virtual ACE_Asynch_Write_Stream_Result_Impl
00448 {
00449 public:
00450   virtual ~ACE_Asynch_Write_File_Result_Impl (void);
00451 
00452 protected:
00453   /// Do-nothing constructor.
00454   ACE_Asynch_Write_File_Result_Impl (void);
00455 };
00456 
00457 /**
00458  * @class ACE_Asynch_Accept_Impl
00459  *
00460  * @brief Abstract base class for all the concrete implementation
00461  * classes that provide different implementations for the
00462  * ACE_Asynch_Accept.
00463  *
00464  */
00465 class ACE_Export ACE_Asynch_Accept_Impl : public virtual ACE_Asynch_Operation_Impl
00466 {
00467 public:
00468   virtual ~ACE_Asynch_Accept_Impl (void);
00469 
00470   /**
00471    * This starts off an asynchronous accept.  The asynchronous accept
00472    * call also allows any initial data to be returned to the
00473    * <handler>.  Upto <bytes_to_read> will be read and stored in the
00474    * <message_block>.  The <accept_handle> will be used for the
00475    * <accept> call.  If (<accept_handle> == INVALID_HANDLE), a new
00476    * handle will be created.
00477    *
00478    * <message_block> must be specified. This is because the address of
00479    * the new connection is placed at the end of this buffer.
00480    */
00481   virtual int accept (ACE_Message_Block &message_block,
00482                       size_t bytes_to_read,
00483                       ACE_HANDLE accept_handle,
00484                       const void *act,
00485                       int priority,
00486                     int signal_number) = 0;
00487 
00488 protected:
00489   /// Do-nothing constructor.
00490   ACE_Asynch_Accept_Impl (void);
00491 };
00492 
00493 /**
00494  * @class ACE_Asynch_Accept_Result_Impl
00495  *
00496  * @brief Abstract base class for all the concrete implementation
00497  * classes that provide different implementations for the
00498  * ACE_Asynch_Accept.
00499  *
00500  */
00501 class ACE_Export ACE_Asynch_Accept_Result_Impl : public virtual ACE_Asynch_Result_Impl
00502 {
00503 public:
00504   virtual ~ACE_Asynch_Accept_Result_Impl (void);
00505 
00506   /// The number of bytes which were requested at the start of the
00507   /// asynchronous accept.
00508   virtual size_t bytes_to_read (void) const = 0;
00509 
00510   /// Message block which contains the read data.
00511   virtual ACE_Message_Block &message_block (void) const = 0;
00512 
00513   /// I/O handle used for accepting new connections.
00514   virtual ACE_HANDLE listen_handle (void) const = 0;
00515 
00516   /// I/O handle for the new connection.
00517   virtual ACE_HANDLE accept_handle (void) const = 0;
00518 
00519 protected:
00520   /// Do-nothing constructor.
00521   ACE_Asynch_Accept_Result_Impl (void);
00522 };
00523 
00524 
00525 /**
00526  * @class ACE_Asynch_Connect_Impl
00527  *
00528  * @brief Abstract base class for all the concrete implementation
00529  * classes that provide different implementations for the
00530  * ACE_Asynch_Connect.
00531  *
00532  */
00533 class ACE_Export ACE_Asynch_Connect_Impl : public virtual ACE_Asynch_Operation_Impl
00534 {
00535 public:
00536   virtual ~ACE_Asynch_Connect_Impl (void);
00537 
00538   /**
00539    * This starts off an asynchronous connect
00540    */
00541   virtual int connect (ACE_HANDLE connect_handle,
00542                        const ACE_Addr & remote_sap,
00543                        const ACE_Addr & local_sap,
00544                        int   reuse_addr,
00545                        const void *act,
00546                        int   priority,
00547                        int   signal_number) = 0;
00548 
00549 protected:
00550   /// Do-nothing constructor.
00551   ACE_Asynch_Connect_Impl (void);
00552 };
00553 
00554 /**
00555  * @class ACE_Asynch_Connect_Result_Impl
00556  *
00557  * @brief Abstract base class for all the concrete implementation
00558  * classes that provide different implementations for the
00559  * ACE_Asynch_Connect.
00560  *
00561  */
00562 class ACE_Export ACE_Asynch_Connect_Result_Impl : public virtual ACE_Asynch_Result_Impl
00563 {
00564 public:
00565   virtual ~ACE_Asynch_Connect_Result_Impl (void);
00566 
00567   /// I/O handle for the connection.
00568   virtual ACE_HANDLE connect_handle (void) const = 0;
00569 
00570 protected:
00571   /// Do-nothing constructor.
00572   ACE_Asynch_Connect_Result_Impl (void);
00573 };
00574 
00575 
00576 /**
00577  * @class ACE_Asynch_Transmit_File_Impl
00578  *
00579  * @brief Abstract base class for all the concrete implementation
00580  * classes that provide different implementations for the
00581  * ACE_Asynch_Transmit_File.
00582  *
00583  */
00584 class ACE_Asynch_Transmit_File_Impl : public virtual ACE_Asynch_Operation_Impl
00585 {
00586 public:
00587   virtual ~ACE_Asynch_Transmit_File_Impl (void);
00588 
00589   /// This starts off an asynchronous transmit file.
00590   virtual int transmit_file (ACE_HANDLE file,
00591                              ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
00592                              size_t bytes_to_write,
00593                              u_long offset,
00594                              u_long offset_high,
00595                              size_t bytes_per_send,
00596                              u_long flags,
00597                              const void *act,
00598                              int priority,
00599                              int signal_number) = 0;
00600 
00601 protected:
00602   /// Do-nothing constructor.
00603   ACE_Asynch_Transmit_File_Impl (void);
00604 };
00605 
00606 /**
00607  * @class ACE_Asynch_Transmit_File_Result_Impl
00608  *
00609  * @brief Abstract base class for all the concrete implementation
00610  * classes that provide different implementations for the
00611  * ACE_Asynch_Transmit_File::Result.
00612  *
00613  */
00614 class ACE_Export ACE_Asynch_Transmit_File_Result_Impl : public virtual ACE_Asynch_Result_Impl
00615 {
00616 public:
00617   virtual ~ACE_Asynch_Transmit_File_Result_Impl (void);
00618 
00619   /// Socket used for transmitting the file.
00620   virtual ACE_HANDLE socket (void) const = 0;
00621 
00622   /// File from which the data is read.
00623   virtual ACE_HANDLE file (void) const = 0;
00624 
00625   /// Header and trailer data associated with this transmit file.
00626   virtual ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer (void) const = 0;
00627 
00628   /// The number of bytes which were requested at the start of the
00629   /// asynchronous transmit file.
00630   virtual size_t bytes_to_write (void) const = 0;
00631 
00632   /// Number of bytes per send requested at the start of the transmit
00633   /// file.
00634   virtual size_t bytes_per_send (void) const = 0;
00635 
00636   /// Flags which were passed into transmit file.
00637   virtual u_long flags (void) const = 0;
00638 
00639 protected:
00640   /// Do-nothing constructor.
00641   ACE_Asynch_Transmit_File_Result_Impl (void);
00642 };
00643 
00644 
00645 /**
00646  * @class ACE_Asynch_Read_Dgram_Impl
00647  *
00648  * @brief Abstract base class for all the concrete implementation
00649  * classes that provide different implementations for the
00650  * ACE_Asynch_Read_Dgram
00651  *
00652  */
00653 class ACE_Export ACE_Asynch_Read_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl
00654 {
00655 public:
00656   virtual ~ACE_Asynch_Read_Dgram_Impl (void);
00657 
00658   /** This starts off an asynchronous read.  Upto
00659    * <message_block->total_size()> will be read and stored in the
00660    * <message_block>.  <message_block>'s <wr_ptr> will be updated to reflect
00661    * the added bytes if the read operation is successful completed.
00662    * Return code of 1 means immediate success and <number_of_bytes_recvd>
00663    * will contain number of bytes read.  The <ACE_Handler::handle_read_dgram>
00664    * method will still be called.  Return code of 0 means the IO will
00665    * complete proactively.  Return code of -1 means there was an error, use
00666    * errno to get the error code.
00667    *
00668    * Scatter/gather is supported on WIN32 by using the <message_block->cont()>
00669    * method.  Up to ACE_IOV_MAX <message_block>'s are supported.  Upto 
00670    * <message_block->size()> bytes will be read into each <message block> for
00671    * a total of <message_block->total_size()> bytes.  All <message_block>'s
00672    * <wr_ptr>'s will be updated to reflect the added bytes for each 
00673    * <message_block>
00674    *
00675    * Priority of the operation is specified by <priority>. On POSIX4-Unix,
00676    * this is supported. Works like <nice> in Unix. Negative values are not
00677    * allowed. 0 means priority of the operation same as the process
00678    * priority. 1 means priority of the operation is one less than
00679    * process. And so forth. On Win32, <priority> is a no-op.
00680    * <signal_number> is the POSIX4 real-time signal number to be used
00681    * for the operation. <signal_number> ranges from ACE_SIGRTMIN to
00682    * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems.
00683    */
00684   virtual ssize_t recv (ACE_Message_Block *message_block,
00685                         size_t &number_of_bytes_recvd,
00686                         int flags,
00687                         int protocol_family,
00688                         const void *act,
00689                         int priority,
00690                         int signal_number) = 0;
00691 
00692 protected:
00693   /// Do-nothing constructor.
00694   ACE_Asynch_Read_Dgram_Impl (void);
00695 };
00696 
00697 /**
00698  * @class ACE_Asynch_Read_Dgram_Result_Impl
00699  *
00700  * @brief Abstract base class for all the concrete implementation
00701  * classes that provide different implementations for the
00702  * ACE_Asynch_Read_Dgram::Result class.
00703  *
00704  */
00705 class ACE_Export ACE_Asynch_Read_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl
00706 {
00707 public:
00708   virtual ~ACE_Asynch_Read_Dgram_Result_Impl (void);
00709 
00710   /// Message block which contains the read data
00711   virtual ACE_Message_Block *message_block (void) const = 0;
00712 
00713   /// The number of bytes which were requested at the start of the
00714   /// asynchronous read.
00715   virtual size_t bytes_to_read (void) const = 0;
00716 
00717   /// The address of where the packet came from
00718   virtual int remote_address (ACE_Addr& addr) const = 0;
00719 
00720   /// The flags used in the read
00721   virtual int flags (void) const = 0;
00722 
00723   /// I/O handle used for reading.
00724   virtual ACE_HANDLE handle (void) const = 0;
00725 
00726 protected:
00727   /// Do-nothing constructor.
00728   ACE_Asynch_Read_Dgram_Result_Impl (void);
00729 };
00730 
00731 /**
00732  * @class ACE_Asynch_Write_Dgram_Impl
00733  *
00734  * @brief Abstract base class for all the concrete implementation
00735  * classes that provide different implementations for the
00736  * ACE_Asynch_Write_Dgram class.
00737  *
00738  */
00739 class ACE_Export ACE_Asynch_Write_Dgram_Impl : public virtual ACE_Asynch_Operation_Impl
00740 {
00741 public:
00742   virtual ~ACE_Asynch_Write_Dgram_Impl (void);
00743 
00744   /** This starts off an asynchronous send.  Upto
00745    * <message_block->total_length()> will be sent.  <message_block>'s 
00746    * <rd_ptr> will be updated to reflect the sent bytes if the send operation
00747    * is successful completed.
00748    * Return code of 1 means immediate success and <number_of_bytes_sent>
00749    * is updated to number of bytes sent.  The <ACE_Handler::handle_write_dgram>
00750    * method will still be called.  Return code of 0 means the IO will
00751    * complete proactively.  Return code of -1 means there was an error, use
00752    * errno to get the error code.
00753    *
00754    * Scatter/gather is supported on WIN32 by using the <message_block->cont()>
00755    * method.  Up to ACE_IOV_MAX <message_block>'s are supported.  Upto 
00756    * <message_block->length()> bytes will be sent from each <message block>
00757    * for a total of <message_block->total_length()> bytes.  All
00758    * <message_block>'s <rd_ptr>'s will be updated to reflect the bytes sent
00759    * from each <message_block>.
00760    *
00761    * Priority of the operation is specified by <priority>. On POSIX4-Unix,
00762    * this is supported. Works like <nice> in Unix. Negative values are not
00763    * allowed. 0 means priority of the operation same as the process
00764    * priority. 1 means priority of the operation is one less than
00765    * process. And so forth. On Win32, this argument is a no-op.
00766    * <signal_number> is the POSIX4 real-time signal number to be used
00767    * for the operation. <signal_number> ranges from ACE_SIGRTMIN to
00768    * ACE_SIGRTMAX. This argument is a no-op on non-POSIX4 systems.
00769    */
00770   virtual ssize_t send (ACE_Message_Block *message_block,
00771                         size_t &number_of_bytes_sent,
00772                         int flags,
00773                         const ACE_Addr &addr,
00774                         const void *act,
00775                         int priority,
00776                         int signal_number) = 0;
00777 
00778 protected:
00779   /// Do-nothing constructor.
00780   ACE_Asynch_Write_Dgram_Impl (void);
00781 };
00782 
00783 /**
00784  * @class ACE_Asynch_Write_Dgram_Result_Impl
00785  *
00786  * @brief Abstract base class for all the concrete implementation
00787  * classes that provide different implementations for the
00788  * ACE_Asynch_Write_Dgram::Result class.
00789  *
00790  */
00791 class ACE_Export ACE_Asynch_Write_Dgram_Result_Impl : public virtual ACE_Asynch_Result_Impl
00792 {
00793 public:
00794   virtual ~ACE_Asynch_Write_Dgram_Result_Impl (void);
00795 
00796   /// The number of bytes which were requested at the start of the
00797   /// asynchronous write.
00798   virtual size_t bytes_to_write (void) const = 0;
00799 
00800   /// Message block which contains the sent data
00801   virtual ACE_Message_Block *message_block (void) const = 0;
00802 
00803   /// The flags using in the write
00804   virtual int flags (void) const = 0;
00805 
00806   /// I/O handle used for writing.
00807   virtual ACE_HANDLE handle (void) const = 0;
00808 
00809 protected:
00810   /// Do-nothing constructor.
00811   ACE_Asynch_Write_Dgram_Result_Impl (void);
00812 };
00813 
00814 #if defined (__ACE_INLINE__)
00815 #include "ace/Asynch_IO_Impl.i"
00816 #endif /* __ACE_INLINE__ */
00817 
00818 #endif /* ACE_HAS_AIO_CALLS  || !ACE_HAS_WINCE && ACE_WIN32 */
00819 #include "ace/post.h"
00820 #endif /* ACE_ASYNCH_IO_IMPL_H */

Generated on Mon Jun 16 11:19:07 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002