Asynch_IO_Impl.h

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

Generated on Thu Nov 9 09:41:46 2006 for ACE by doxygen 1.3.6