tmp try with luke code

This commit is contained in:
hugogogo
2022-07-13 14:31:34 +02:00
parent 272404a0c4
commit 461c10b6a2
2 changed files with 116 additions and 11 deletions

View File

@@ -8,17 +8,28 @@
# include <cstdio> // perror
# include <exception>
# include <stdexcept>
# include <unistd.h> // close
# include <iostream> // cout, cin
# include <sys/socket.h> // socket, accept, listen, send, recv, bind, connect, setsockopt, getsockname
# include <netinet/in.h> // sockaddr_in
// # include <netinet/ip.h> // usefull for what ?
# include <arpa/inet.h> // htonl, htons, ntohl, ntohs, inet_addr
# include <poll.h> // poll
# include <fcntl.h> // fcntl
class Webserv
{
public:
//Webserv(Placeholder);
Webserv();
Webserv(Webserv const &src);
// Webserv(Webserv const &src);
~Webserv();
Webserv &operator=(Webserv const &rhs);
// Webserv &operator=(Webserv const &rhs);
void bind(in_port_t port);
void listen(unsigned int max_connections);
void start();
private:
int _socket_fd;
@@ -27,4 +38,4 @@ class Webserv
};
#endif
#endif