/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Server.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: iherman- # include # include # include # include # include "../User/User.hpp" # define PORT_DEFAULT 9898 class Server { private: static const int kConnectionQueueLimit; int port_; int serverSocket_; std::string password_; std::vector sockets_; std::map clients_; bool handleClient(User& client); void addClient(); std::vector::iterator removeClient(std::vector::iterator client); Server(const Server& other); Server &operator=(const Server& other); public: Server(); Server(int port, const std::string& password); ~Server(); void run(); }; #endif // SERVER_HPP