You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
643 B

#pragma once
#include "webserv.hpp"
class Socket {
2 years ago
int _fd;
//int _clients_amount;
Socket *_parent;
std::vector<Socket *> _childs;
struct sockaddr_in _address;
2 years ago
string _header;
string _content;
2 years ago
std::map<string,std::vector<string> > _request;
2 years ago
2 years ago
bool getRequest(string paquet);
bool parseHeader();
int answer(Env *env);
2 years ago
void send_answer(string msg);
bool waitHeader();
public:
Socket(listen_t listen);
Socket(int fd, Socket *parent);
~Socket(void);
listen_t _listen;
static fd_set _readfds;
2 years ago
static int _max_fd;
static int _min_fd;
static int _amount;
2 years ago
int launch(void);
void set_fds(void);
void refresh(Env *env);
};