00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONEXUSEXCEPT_READ_H
00020 #define CONEXUSEXCEPT_READ_H
00021
00022 #include <conexus/except.h>
00023
00024 namespace Conexus
00025 {
00026
00032 class read_exception: public conexus_exception
00033 {
00034 public:
00035 read_exception(int e=0): conexus_exception("Unknown exception, read failed.",e,"read")
00036 { }
00037 read_exception(const std::string s, int e=0): conexus_exception(s,e,"read")
00038 { }
00039 }
00040 ;
00041
00042 namespace exception
00043 {
00044
00045 namespace read
00046 {
00047
00054 class bad_fd: public read_exception
00055 {
00056 public:
00057 bad_fd(): read_exception("sockfd is not a valid descriptor.", EBADF)
00058 { }
00059 }
00060 ;
00061
00069 class connection_refused: public read_exception
00070 {
00071 public:
00072 connection_refused(): read_exception("A remote host refused to allow the network connection.", ECONNREFUSED)
00073 { }
00074 }
00075 ;
00076
00084 class not_connected: public read_exception
00085 {
00086 public:
00087 not_connected(): read_exception("The socket is associated with a connection-oriented protocol and has not been connected", ENOTCONN)
00088 { }
00089 }
00090 ;
00091
00098 class not_socket: public read_exception
00099 {
00100 public:
00101 not_socket(): read_exception("The argument s is not a socket.", ENOTSOCK)
00102 { }
00103 }
00104 ;
00105
00114 class would_block: public read_exception
00115 {
00116 public:
00117 would_block(): read_exception("The socket is marked non-blocking and the requested operation would block.", EAGAIN)
00118 { }
00119 }
00120 ;
00121
00129 class interrupted: public read_exception
00130 {
00131 public:
00132 interrupted(): read_exception("The receive was interrupted by delivery of a signal before any data were available.", EINTR)
00133 { }
00134 }
00135 ;
00136
00143 class invalid_user_space_address: public read_exception
00144 {
00145 public:
00146 invalid_user_space_address(): read_exception("An invalid user space address was specified for a parameter.", EFAULT)
00147 { }
00148 }
00149 ;
00150
00157 class invalid_argument: public read_exception
00158 {
00159 public:
00160 invalid_argument(): read_exception("Invalid argument passed.", EINVAL)
00161 { }
00162 }
00163 ;
00164
00171 class no_memory: public read_exception
00172 {
00173 public:
00174 no_memory(): read_exception("No memory available.", ENOMEM)
00175 { }
00176 }
00177 ;
00178
00184 class not_opened: public read_exception
00185 {
00186 public:
00187 not_opened(): read_exception("Trying to read from a device that can't be opened.", -1)
00188 { }
00189 }
00190 ;
00191
00197 class not_bound: public read_exception
00198 {
00199 public:
00200 not_bound(): read_exception("Trying to read from a socket that can't be bound.", -1)
00201 { }
00202 }
00203 ;
00204
00212 class disconnected: public read_exception
00213 {
00214 public:
00215 disconnected(): read_exception("Trying to read from a socket where the peer has performed an orderly shutdown.", -1)
00216 { }
00217 }
00218 ;
00219
00227 class timeout: public read_exception
00228 {
00229 public:
00230 timeout(): read_exception("The read operation timed out.", -1)
00231 { }
00232 }
00233 ;
00234
00242 class eof: public read_exception
00243 {
00244 public:
00245 eof(): read_exception("End of file.", -1)
00246 { }
00247 }
00248 ;
00249
00250
00251 }
00252
00253 }
00254
00255 }
00256
00257 #endif // CONEXUSSEND_ERROR_H