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

SOCK_IO.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    SOCK_IO.h
00006  *
00007  *  $Id: SOCK_IO.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
00010  */
00011 //==========================================================================
00012 
00013 #ifndef ACE_SOCK_IO_H
00014 #define ACE_SOCK_IO_H
00015 
00016 #include "ace/pre.h"
00017 
00018 #include "ace/SOCK.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/ACE.h"
00025 
00026 /**
00027  * @class ACE_SOCK_IO
00028  *
00029  * @brief Defines the methods for the ACE socket wrapper I/O routines
00030  * (e.g., send/recv).
00031  *
00032  *
00033  * If <timeout> == 0, then the call behaves as a normal
00034  * send/recv call, i.e., for blocking sockets, the call will
00035  * block until action is possible; for non-blocking sockets,
00036  * EWOULDBLOCK will be returned if no action is immediately
00037  * possible.
00038  * If <timeout> != 0, the call will wait until the relative time
00039  * specified in *<timeout> elapses.
00040  * Errors are reported by -1 and 0 return values.  If the
00041  * operation times out, -1 is returned with <errno == ETIME>.
00042  * If it succeeds the number of bytes transferred is returned.
00043  * Methods with the extra <flags> argument will always result in
00044  * <send> getting called. Methods without the extra <flags>
00045  * argument will result in <send> getting called on Win32
00046  * platforms, and <write> getting called on non-Win32 platforms.
00047  */
00048 class ACE_Export ACE_SOCK_IO : public ACE_SOCK
00049 {
00050 public:
00051   // = Initialization and termination methods.
00052 
00053   /// Constructor.
00054   ACE_SOCK_IO (void);
00055 
00056   /// Destructor.
00057   ~ACE_SOCK_IO (void);
00058 
00059   /// Recv an <n> byte buffer from the connected socket.
00060   ssize_t recv (void *buf,
00061                 size_t n,
00062                 int flags,
00063                 const ACE_Time_Value *timeout = 0) const;
00064 
00065   /// Recv an <n> byte buffer from the connected socket.
00066   ssize_t recv (void *buf,
00067                 size_t n,
00068                 const ACE_Time_Value *timeout = 0) const;
00069 
00070   /// Recv an <iovec> of size <n> from the connected socket.
00071   ssize_t recvv (iovec iov[],
00072                  int n,
00073                  const ACE_Time_Value *timeout = 0) const;
00074 
00075   /// Same as above.  Deprecated.
00076   ssize_t recv (iovec iov[],
00077                 size_t n,
00078                 const ACE_Time_Value *timeout = 0) const;
00079 
00080   /**
00081    * Allows a client to read from a socket without having to provide a
00082    * buffer to read.  This method determines how much data is in the
00083    * socket, allocates a buffer of this size, reads in the data, and
00084    * returns the number of bytes read.  The caller is responsible for
00085    * deleting the member in the <iov_base> field of <io_vec> using
00086    * delete [] io_vec->iov_base.
00087    */
00088   ssize_t recvv (iovec *io_vec,
00089                  const ACE_Time_Value *timeout = 0) const;
00090 
00091   /// Same as above.  Deprecated.
00092   ssize_t recv (iovec *io_vec,
00093                 const ACE_Time_Value *timeout = 0) const;
00094 
00095   /// Recv <n> varargs messages to the connected socket.
00096   ssize_t recv (size_t n,
00097                 ...) const;
00098 
00099   /// Recv <n> bytes via Win32 <ReadFile> using overlapped I/O.
00100   ssize_t recv (void *buf,
00101                 size_t n,
00102                 ACE_OVERLAPPED *overlapped) const;
00103 
00104   /// Send an <n> byte buffer to the connected socket.
00105   ssize_t send (const void *buf,
00106                 size_t n,
00107                 int flags,
00108                 const ACE_Time_Value *timeout = 0) const;
00109 
00110   /// Send an <n> byte buffer to the connected socket.
00111   ssize_t send (const void *buf,
00112                 size_t n,
00113                 const ACE_Time_Value *timeout = 0) const;
00114 
00115   /// Send an <iovec> of size <n> to the connected socket.
00116   ssize_t sendv (const iovec iov[],
00117                  int n,
00118                  const ACE_Time_Value *timeout = 0) const;
00119 
00120   /// Same as above.  Deprecated.
00121   ssize_t send (const iovec iov[],
00122                 size_t n,
00123                 const ACE_Time_Value *timeout = 0) const;
00124 
00125   /// Send <n> varargs messages to the connected socket.
00126   ssize_t send (size_t n,
00127                 ...) const;
00128 
00129   /// Send <n> bytes via Win32 <WriteFile> using overlapped I/O.
00130   ssize_t send (const void *buf,
00131                 size_t n,
00132                 ACE_OVERLAPPED *overlapped) const;
00133 
00134   /// Dump the state of an object.
00135   void dump (void) const;
00136 
00137   /// Declare the dynamic allocation hooks.
00138   ACE_ALLOC_HOOK_DECLARE;
00139 };
00140 
00141 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00142 #include "ace/SOCK_IO.i"
00143 #endif
00144 
00145 #include "ace/post.h"
00146 
00147 #endif /* ACE_SOCK_IO_H */

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