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.
25 lines
479 B
25 lines
479 B
#pragma once
|
|
#include "webserv.hpp"
|
|
|
|
class Socket {
|
|
struct sockaddr_in _addr;
|
|
protected:
|
|
int _master_socket;
|
|
int _clients_amount;
|
|
std::vector<int> _clients;
|
|
int _type;
|
|
|
|
public:
|
|
listen_t _listen;
|
|
static fd_set _readfds;
|
|
static int _max_fd;
|
|
static int _min_fd;
|
|
static int _amount;
|
|
Socket(listen_t listen);
|
|
~Socket();
|
|
int launch();
|
|
void set_fds();
|
|
void refresh(Env *env);
|
|
void answer(Env *env, int fd, string request);
|
|
void send_answer(int fd, string msg);
|
|
};
|
|
|