except_connect.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONEXUSEXCEPT_CONNECT_H
00020 #define CONEXUSEXCEPT_CONNECT_H
00021
00022 #include <conexus/except.h>
00023
00024 namespace Conexus
00025 {
00026
00032 class connect_exception: public conexus_exception
00033 {
00034 public:
00035 connect_exception ( int e=0 ) : conexus_exception ( "Unknown exception, socket not connected.",e,"connect" ) { }
00036 connect_exception ( const std::string s, int e=0 ) : conexus_exception ( s,e,"connect" ) { }
00037 };
00038
00039 namespace exception
00040 {
00041
00042
00043 namespace connect
00044 {
00045
00046
00054 class bad_fd: public connect_exception
00055 {
00056 public:
00057 bad_fd() : connect_exception ( ::strerror ( EBADF ), EBADF ) { }
00058 };
00059
00067 class segfault: public connect_exception
00068 {
00069 public:
00070 segfault() : connect_exception ( ::strerror ( EFAULT ), EFAULT ) { }
00071 };
00072
00080 class not_socket: public connect_exception
00081 {
00082 public:
00083 not_socket() : connect_exception ( ::strerror ( ENOTSOCK ), ENOTSOCK ) { }
00084 };
00085
00093 class connected_socket: public connect_exception
00094 {
00095 public:
00096 connected_socket() : connect_exception ( ::strerror ( EISCONN ), EISCONN ) { }
00097 };
00098
00106 class connection_refused: public connect_exception
00107 {
00108 public:
00109 connection_refused() : connect_exception ( ::strerror(ECONNREFUSED), ECONNREFUSED ) { }
00110 };
00111
00119 class timeout: public connect_exception
00120 {
00121 public:
00122 timeout() : connect_exception ( ::strerror(ETIMEDOUT), ETIMEDOUT ) { }
00123 };
00124
00132 class network_unreachable: public connect_exception
00133 {
00134 public:
00135 network_unreachable() : connect_exception ( ::strerror(ENETUNREACH), ENETUNREACH ) { }
00136 };
00137
00145 class address_in_use: public connect_exception
00146 {
00147 public:
00148 address_in_use() : connect_exception ( ::strerror(EADDRINUSE), EADDRINUSE ) { }
00149 };
00150
00158 class not_immediate: public connect_exception
00159 {
00160 public:
00161 not_immediate() : connect_exception ( ::strerror(EINPROGRESS), EINPROGRESS ) { }
00162 };
00163
00171 class in_progress: public connect_exception
00172 {
00173 public:
00174 in_progress() : connect_exception ( ::strerror(EALREADY), EALREADY ) { }
00175 };
00176
00184 class try_again: public connect_exception
00185 {
00186 public:
00187 try_again() : connect_exception ( ::strerror(EAGAIN), EAGAIN ) { }
00188 };
00189
00197 class af_not_supported: public connect_exception
00198 {
00199 public:
00200 af_not_supported() : connect_exception ( ::strerror(EAFNOSUPPORT), EAFNOSUPPORT ) { }
00201 };
00202
00210 class access: public connect_exception
00211 {
00212 public:
00213 access() : connect_exception ( ::strerror(EACCES), EACCES ) { }
00214 };
00215
00222 class no_remote_address: public connect_exception
00223 {
00224 public:
00225 no_remote_address() : connect_exception ( "Socket cannot auto connect because a default remote address has not been set.", -1 ) { }
00226 };
00227
00233 class no_socket_connect: public connect_exception
00234 {
00235 public:
00236 no_socket_connect() : connect_exception ( "The Socket class connect() method cannot be called without an address.", -1 )
00237 { }
00238 };
00239
00245 class not_open: public connect_exception
00246 {
00247 public:
00248 not_open() : connect_exception ( "Socket could not be opened for connect() method.", -1 )
00249 { }
00250 };
00251
00257 class no_udpposet_connect: public connect_exception
00258 {
00259 public:
00260 no_udpposet_connect() : connect_exception ( "The UDPPoset class connect() method cannot be called.", -1 )
00261 { }
00262 };
00263
00264
00265
00266 }
00267 }
00268 }
00269
00270 #endif // CONEXUSCONNECT_ERROR_H