splitted Webserv.cpp

This commit is contained in:
LuckyLaszlo
2022-07-29 17:16:26 +02:00
parent e5633a30e4
commit 36868afa30
14 changed files with 446 additions and 448 deletions

35
srcs/webserv/base.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include "Webserv.hpp"
Webserv::Webserv()
{
std::cerr << "Server init\n";
_epfd = ::epoll_create1(0); // (EPOLL_CLOEXEC) for CGI fork ?
if (_epfd == -1)
{
std::perror("err epoll_create1()");
throw std::runtime_error("Epoll init");
}
std::signal(SIGPIPE, signal_handler);
std::signal(SIGINT, signal_handler);
}
/* Webserv::Webserv(Webserv const &src)
{
} */
Webserv::~Webserv()
{
close(_socket_fd);
close(_epfd);
_close_all_clients();
std::cerr << "Server destroyed\n";
}
/* Webserv & Webserv::operator=(Webserv const &rhs)
{
} */