3 // $Id: DEV_IO.inl 80826 2008-03-04 14:51:23Z wotte $
5 #include "ace/OS_NS_sys_uio.h"
6 #include "ace/OS_NS_unistd.h"
7 #include "ace/OS_Memory.h"
11 // Send exactly N bytes from BUF to this device. Keeping trying until
12 // this many bytes are sent.
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
17 ACE_DEV_IO::send_n (const void *buf, size_t n) const
19 ACE_TRACE ("ACE_DEV_IO::send_n");
20 return ACE::write_n (this->get_handle (), buf, n);
23 // Receive exactly N bytes from this file into BUF. Keep trying until
24 // this many bytes are received.
27 ACE_DEV_IO::recv_n (void *buf,
29 const ACE_Time_Value *timeout,
30 size_t *bytes_transferred) const
32 ACE_TRACE ("ACE_DEV_IO::recv_n");
33 #if defined (ACE_WIN32)
34 ACE_UNUSED_ARG (timeout);
36 return ACE::read_n (this->get_handle (),
41 return ACE::recv_n (this->get_handle (),
50 ACE_DEV_IO::send (const void *buf, size_t n) const
52 ACE_TRACE ("ACE_DEV_IO::send");
53 return ACE_OS::write (this->get_handle (), (const char *) buf, n);
57 ACE_DEV_IO::recv (void *buf, size_t n) const
59 ACE_TRACE ("ACE_DEV_IO::recv");
60 return ACE_OS::read (this->get_handle (), (char *) buf, n);
64 ACE_DEV_IO::send (const iovec iov[], size_t n) const
66 ACE_TRACE ("ACE_DEV_IO::send");
67 return ACE_OS::writev (this->get_handle (), iov, static_cast<int> (n));
71 ACE_DEV_IO::recv (iovec iov[], size_t n) const
73 ACE_TRACE ("ACE_DEV_IO::recv");
74 return ACE_OS::readv (this->get_handle (), iov, static_cast<int> (n));
78 ACE_DEV_IO::send (const void *buf, size_t n,
79 ACE_OVERLAPPED *overlapped) const
81 ACE_TRACE ("ACE_DEV_IO::send");
82 return ACE_OS::write (this->get_handle (),
83 (const char *) buf, n,
88 ACE_DEV_IO::recv (void *buf, size_t n,
89 ACE_OVERLAPPED *overlapped) const
91 ACE_TRACE ("ACE_DEV_IO::recv");
92 return ACE_OS::read (this->get_handle (), (char *) buf, n,
96 #if defined (ACE_HAS_STREAM_PIPES)
98 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
100 ACE_TRACE ("ACE_DEV_IO::recv");
101 return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
105 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
107 ACE_TRACE ("ACE_DEV_IO::send");
108 return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
112 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
114 ACE_TRACE ("ACE_DEV_IO::recv");
115 return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
119 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
121 ACE_TRACE ("ACE_DEV_IO::send");
122 return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
124 #endif /* ACE_HAS_STREAM_PIPES */
126 ACE_END_VERSIONED_NAMESPACE_DECL