class version of poll ref

This commit is contained in:
hugogogo
2022-07-22 22:00:32 +02:00
parent 63581c8a42
commit 15e00d03ce
4 changed files with 89 additions and 171 deletions

View File

@@ -33,16 +33,21 @@ class Webserv
void bind(in_port_t port);
void listen(unsigned int max_connections);
void start(int timeout);
void start(int timeout, int bufsize);
private:
int _socket_fd;
std::map<std::string, std::string> _request;
std::map<std::string, std::string> _response;
std::vector<struct pollfd> _fds;
int _nfds;
void _add_fd(int sd, short event);
void _add_fd(int sd, short event);
void _accept_connection();
void _connect_socket(int it, int bufsize);
void _close_fd(int it);
std::vector<struct pollfd> _fds;
std::vector<struct pollfd>::iterator _it;
std::vector<struct pollfd>::iterator _it_end;
};