add: client life time

This commit is contained in:
Talyx
2022-02-21 18:37:48 +03:00
parent 582310c70d
commit e107b2a3e5
5 changed files with 94 additions and 10 deletions

View File

@@ -48,6 +48,14 @@ class Server
size_t left;
enum e_req_status req_status;
} t_client_status;
typedef struct s_tmp_fd
{
serverListen ip_port;
struct timeval last_modif;
}t_tmp_fd;
bool TimeToDie(struct timeval &last_modif, int lifeTime);
int delete_fd(std::map<int, t_tmp_fd *> &map, int fd);
std::map<int, t_tmp_fd *> free_socket;
public:
Server();