init
This commit is contained in:
27
srcs/Webserv.cpp
Normal file
27
srcs/Webserv.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#include "Webserv.hpp"
|
||||
|
||||
Webserv::Webserv()
|
||||
{
|
||||
_socket_fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||
if (_socket_fd == -1)
|
||||
{
|
||||
perror("socket(): ");
|
||||
throw std::runtime_error("Socket init");
|
||||
}
|
||||
}
|
||||
|
||||
Webserv::Webserv(Webserv const &src)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Webserv::~Webserv()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Webserv & Webserv::operator=(Webserv const &rhs)
|
||||
{
|
||||
|
||||
}
|
||||
30
srcs/Webserv.hpp
Normal file
30
srcs/Webserv.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
#ifndef WEBSERV_HPP
|
||||
# define WEBSERV_HPP
|
||||
|
||||
# include <string>
|
||||
# include <map>
|
||||
# include <cerrno> // errno
|
||||
# include <cstdio> // perror
|
||||
# include <exception>
|
||||
# include <stdexcept>
|
||||
|
||||
# include <sys/socket.h> // socket, accept, listen, send, recv, bind, connect, setsockopt, getsockname
|
||||
|
||||
class Webserv
|
||||
{
|
||||
public:
|
||||
//Webserv(Placeholder);
|
||||
Webserv();
|
||||
Webserv(Webserv const &src);
|
||||
~Webserv();
|
||||
Webserv &operator=(Webserv const &rhs);
|
||||
|
||||
private:
|
||||
int _socket_fd;
|
||||
std::map<std::string, std::string> _request;
|
||||
std::map<std::string, std::string> _response;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
1
srcs/main.cpp
Normal file
1
srcs/main.cpp
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user