23 #ifndef SOCKETEXCEPTION_HH_
24 # define SOCKETEXCEPTION_HH_
26 #define HERE __FILE__, __LINE__
31 #define NEW_EXCEPTION(Name) \
32 class Name : public Exception \
35 Name(const std::string& desc, const char * file, int line) : \
36 Exception(desc, file, line) \
38 Name() : Exception() {} \
39 Name(const char *file, int line) : Exception(file, line) {} \
58 Exception(
const std::string& err,
const char* file,
int line) :
61 _error =
"Exception: " + err;
64 void print(std::ostream& stream)
const;
const char * get_file() const
void print(std::ostream &stream) const
Socket & operator<<(Socket &s, const std::string &str)
write a string on current socket
Network namespace represent all networks connection.
NEW_EXCEPTION(HostnameError)
exception launched when a hostname is incorrect
Exception(const char *file, int line)
This class is the top exception class used in libsocket.
Exception(const std::string &err, const char *file, int line)
const std::string & get_error() const