DEV_IO.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // DEV_IO.inl,v 4.3 2005/10/28 16:14:52 ossama Exp
00004 
00005 #include "ace/OS_NS_sys_uio.h"
00006 #include "ace/OS_NS_unistd.h"
00007 #include "ace/OS_Memory.h"
00008 
00009 #include "ace/ACE.h"
00010 
00011 // Send exactly N bytes from BUF to this device.  Keeping trying until
00012 // this many bytes are sent.
00013 
00014 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00015 
00016 ACE_INLINE ssize_t
00017 ACE_DEV_IO::send_n (const void *buf, size_t n) const
00018 {
00019   ACE_TRACE ("ACE_DEV_IO::send_n");
00020   return ACE::write_n (this->get_handle (), buf, n);
00021 }
00022 
00023 // Receive exactly N bytes from this file into BUF.  Keep trying until
00024 // this many bytes are received.
00025 
00026 ACE_INLINE ssize_t
00027 ACE_DEV_IO::recv_n (void *buf,
00028                     size_t n,
00029                     const ACE_Time_Value *timeout,
00030                     size_t *bytes_transferred) const
00031 {
00032   ACE_TRACE ("ACE_DEV_IO::recv_n");
00033 #if defined (ACE_WIN32)
00034   ACE_UNUSED_ARG (timeout);
00035 
00036   return ACE::read_n (this->get_handle (),
00037                       buf,
00038                       n,
00039                       bytes_transferred);
00040 #else
00041   return ACE::recv_n (this->get_handle (),
00042                       buf,
00043                       n,
00044                       timeout,
00045                       bytes_transferred);
00046 #endif /*ACE_WIN32*/
00047 }
00048 
00049 ACE_INLINE ssize_t
00050 ACE_DEV_IO::send (const void *buf, size_t n) const
00051 {
00052   ACE_TRACE ("ACE_DEV_IO::send");
00053   return ACE_OS::write (this->get_handle (), (const char *) buf, n);
00054 }
00055 
00056 ACE_INLINE ssize_t
00057 ACE_DEV_IO::recv (void *buf, size_t n) const
00058 {
00059   ACE_TRACE ("ACE_DEV_IO::recv");
00060   return ACE_OS::read (this->get_handle (), (char *) buf, n);
00061 }
00062 
00063 ACE_INLINE ssize_t
00064 ACE_DEV_IO::send (const iovec iov[], size_t n) const
00065 {
00066   ACE_TRACE ("ACE_DEV_IO::send");
00067   return ACE_OS::writev (this->get_handle (), iov, static_cast<int> (n));
00068 }
00069 
00070 ACE_INLINE ssize_t
00071 ACE_DEV_IO::recv (iovec iov[], size_t n) const
00072 {
00073   ACE_TRACE ("ACE_DEV_IO::recv");
00074   return ACE_OS::readv (this->get_handle (), iov, static_cast<int> (n));
00075 }
00076 
00077 ACE_INLINE ssize_t
00078 ACE_DEV_IO::send (const void *buf, size_t n,
00079                   ACE_OVERLAPPED *overlapped) const
00080 {
00081   ACE_TRACE ("ACE_DEV_IO::send");
00082   return ACE_OS::write (this->get_handle (),
00083                         (const char *) buf, n,
00084                         overlapped);
00085 }
00086 
00087 ACE_INLINE ssize_t
00088 ACE_DEV_IO::recv (void *buf, size_t n,
00089                   ACE_OVERLAPPED *overlapped) const
00090 {
00091   ACE_TRACE ("ACE_DEV_IO::recv");
00092   return ACE_OS::read (this->get_handle (), (char *) buf, n,
00093                        overlapped);
00094 }
00095 
00096 #if defined (ACE_HAS_STREAM_PIPES)
00097 ACE_INLINE ssize_t
00098 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
00099 {
00100   ACE_TRACE ("ACE_DEV_IO::recv");
00101   return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
00102 }
00103 
00104 ACE_INLINE ssize_t
00105 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
00106 {
00107   ACE_TRACE ("ACE_DEV_IO::send");
00108   return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
00109 }
00110 
00111 ACE_INLINE ssize_t
00112 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
00113 {
00114   ACE_TRACE ("ACE_DEV_IO::recv");
00115   return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
00116 }
00117 
00118 ACE_INLINE ssize_t
00119 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
00120 {
00121   ACE_TRACE ("ACE_DEV_IO::send");
00122   return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
00123 }
00124 #endif /* ACE_HAS_STREAM_PIPES */
00125 
00126 ACE_END_VERSIONED_NAMESPACE_DECL

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