2 #include "ace/OS_NS_sys_uio.h"
3 #include "ace/OS_NS_unistd.h"
4 #include "ace/OS_Memory.h"
8 // Send exactly N bytes from BUF to this device. Keeping trying until
9 // this many bytes are sent.
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
14 ACE_DEV_IO::send_n (const void *buf, size_t n) const
16 ACE_TRACE ("ACE_DEV_IO::send_n");
17 return ACE::write_n (this->get_handle (), buf, n);
20 // Receive exactly N bytes from this file into BUF. Keep trying until
21 // this many bytes are received.
24 ACE_DEV_IO::recv_n (void *buf,
26 const ACE_Time_Value *timeout,
27 size_t *bytes_transferred) const
29 ACE_TRACE ("ACE_DEV_IO::recv_n");
30 #if defined (ACE_WIN32)
31 ACE_UNUSED_ARG (timeout);
33 return ACE::read_n (this->get_handle (),
38 return ACE::recv_n (this->get_handle (),
47 ACE_DEV_IO::send (const void *buf, size_t n) const
49 ACE_TRACE ("ACE_DEV_IO::send");
50 return ACE_OS::write (this->get_handle (), (const char *) buf, n);
54 ACE_DEV_IO::recv (void *buf, size_t n) const
56 ACE_TRACE ("ACE_DEV_IO::recv");
57 return ACE_OS::read (this->get_handle (), (char *) buf, n);
61 ACE_DEV_IO::send (const iovec iov[], size_t n) const
63 ACE_TRACE ("ACE_DEV_IO::send");
64 return ACE_OS::writev (this->get_handle (), iov, static_cast<int> (n));
68 ACE_DEV_IO::recv (iovec iov[], size_t n) const
70 ACE_TRACE ("ACE_DEV_IO::recv");
71 return ACE_OS::readv (this->get_handle (), iov, static_cast<int> (n));
75 ACE_DEV_IO::send (const void *buf, size_t n,
76 ACE_OVERLAPPED *overlapped) const
78 ACE_TRACE ("ACE_DEV_IO::send");
79 return ACE_OS::write (this->get_handle (),
80 (const char *) buf, n,
85 ACE_DEV_IO::recv (void *buf, size_t n,
86 ACE_OVERLAPPED *overlapped) const
88 ACE_TRACE ("ACE_DEV_IO::recv");
89 return ACE_OS::read (this->get_handle (), (char *) buf, n,
93 #if defined (ACE_HAS_STREAM_PIPES)
95 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
97 ACE_TRACE ("ACE_DEV_IO::recv");
98 return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
102 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
104 ACE_TRACE ("ACE_DEV_IO::send");
105 return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
109 ACE_DEV_IO::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
111 ACE_TRACE ("ACE_DEV_IO::recv");
112 return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
116 ACE_DEV_IO::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
118 ACE_TRACE ("ACE_DEV_IO::send");
119 return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
121 #endif /* ACE_HAS_STREAM_PIPES */
123 ACE_END_VERSIONED_NAMESPACE_DECL