mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
feat(socket): add min_config struct
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user