Client class now has getters and setters, and server has 4 functions for main loop
This commit is contained in:
@@ -22,16 +22,27 @@
|
||||
# include <poll.h>
|
||||
|
||||
# include "../Client/Client.hpp"
|
||||
# include <map>
|
||||
|
||||
class Server
|
||||
{
|
||||
private:
|
||||
int port;
|
||||
int port;
|
||||
std::string password;
|
||||
int server_fd;
|
||||
std::vector<pollfd> fds;
|
||||
std::map<int, Client> clients;
|
||||
|
||||
void acceptClient();
|
||||
void readClient(int fd);
|
||||
void removeClient(int fd);
|
||||
|
||||
public:
|
||||
Server();
|
||||
Server(int port);
|
||||
Server(int port, std::string password);
|
||||
~Server();
|
||||
int run();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user