Changeset 10:9cf218bd97ba in xplcommon
- Timestamp:
- 12/29/12 09:02:58 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/xplcommon/posix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/xplcommon/posix/BufferedWaitable.cc
r6 r10 35 35 #include "WritingBuffer.h" 36 36 37 #include <unistd.h> 37 38 #include <poll.h> 38 39 … … 65 66 //------------------------------------------------------------------------------ 66 67 68 ssize_t BufferedWaitable::read(void* dest, size_t length) 69 { 70 return ::read(fd, dest, length); 71 } 72 73 //------------------------------------------------------------------------------ 74 75 ssize_t BufferedWaitable::write(const void* src, size_t length) 76 { 77 return ::write(fd, src, length); 78 } 79 80 //------------------------------------------------------------------------------ 81 67 82 bool BufferedWaitable::isReady() 68 83 { -
src/xplcommon/posix/BufferedWaitable.h
r6 r10 103 103 protected: 104 104 /** 105 * Read using the file descriptor into the given buffer. 105 * Read using the file descriptor at most the given number of 106 * bytes into the given buffer. 107 * 108 * This default implementation uses the read(2) function for 109 * reading. 110 * 111 * @return the number of bytes read (0 in case of end-of-file or 112 * when the connection is closed), -1 on error. 106 113 */ 107 virtual ssize_t read(void* dest, size_t length) = 0;114 virtual ssize_t read(void* dest, size_t length); 108 115 109 116 /** 110 * Write using the file descriptor from the given buffer. 117 * Write using the file descriptor the given number of bytes from 118 * the given buffer. 119 * 120 * This default implementation uses the write(2) function for 121 * writing. 122 * 123 * @return the number of bytes written, or -1 on error. 111 124 */ 112 virtual ssize_t write(const void* src, size_t length) = 0;125 virtual ssize_t write(const void* src, size_t length); 113 126 114 127 /**
Note:
See TracChangeset
for help on using the changeset viewer.