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;
This class is the top exception class used in libsocket.
const std::string & get_error() const
void print(std::ostream &stream) const
const char * get_file() const
Exception(const std::string &err, const char *file, int line)
Exception(const char *file, int line)
Network namespace represent all networks connection.
Socket & operator<<(Socket &s, const std::string &str)
write a string on current socket
#define NEW_EXCEPTION(Name)