feat(socket): add min_config struct

This commit is contained in:
3lswear
2022-02-08 21:09:21 +03:00
parent adf57cd03f
commit a4b5037cb1
2 changed files with 9 additions and 2 deletions

View File

@@ -15,6 +15,9 @@ Socket::Socket(int domain, int type, int protocol, int port, std::string ip)
_addres.sin_port = htons(port);
_addres.sin_addr.s_addr = inet_addr(ip.c_str());
_addrlen = sizeof(_addres);
min_config.ip = ip;
min_config.port = port;
}
Socket::~Socket()

View File

@@ -2,6 +2,8 @@
#define SOCKET_HPP
#include "webserv.hpp"
#include "ServerConfig.hpp"
class Socket
{
private:
@@ -9,9 +11,9 @@ private:
socklen_t _addrlen;
struct sockaddr_in _addres;
Socket();
public:
Socket();
Socket(int domain, int type, int protocol, int port, std::string ip);
int getSocketFd(void);
struct sockaddr_in getAddres(void);
@@ -25,9 +27,11 @@ public:
int init(int nbr);
void checkError(int fd, std::string str);
struct serverListen min_config;
~Socket();
};
#endif
#endif