#ifndef SOCKET_HH #define SOCKET_HH #include #include #include #include #include const int RECVBUF = 256; const int LINELENGTH = 256; class ClientSocket { private: int _socket; bool is_good; std::string buf; std::string addr; void _recv(); public: ClientSocket(int, in_addr); ~ClientSocket(); bool getline(std::string &); void putline(std::string); bool good(); void fill_pollfd(pollfd &); bool has_lines(); std::string get_addr(); }; class ListenSocket { private: int _socket; bool is_good; std::vector clients; public: ListenSocket(int); ClientSocket *get_client(); void release_client(ClientSocket *); bool wait_for_event(int); bool good(); }; #endif