🏗️」 wip: Added proto for Client class

This commit is contained in:
2025-04-14 15:05:26 +02:00
parent 42ab0cfc97
commit 2004386c8d
4 changed files with 39 additions and 4 deletions

View File

@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Client.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/14 14:14:39 by adjoly #+# #+# */
/* Updated: 2025/04/14 15:00:41 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "config/default.hpp"
#include "default.hpp"
#include "requests/default.hpp"
#include <netinet/in.h>
#include <webserv.hpp>
class Client {
public:
Client(int, sockaddr_in);
~Client(void);
void answer(void);
private:
int _fd;
struct sockaddr_in _client_addr;
http::IRequest *_request;
http::Response *_response;
config::Config *_conf;
};

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/11 17:45:43 by adjoly #+# #+# */
/* Updated: 2025/04/14 13:42:20 by adjoly ### ########.fr */
/* Updated: 2025/04/14 14:21:41 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,6 +15,7 @@
#include "log.hpp"
#include <config/default.hpp>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdexcept>
#include <sys/poll.h>
#include <vector>
@ -42,7 +43,7 @@ class Server {
*
* @param The number of the client fd
*/
void _handle_client(int fd);
void _handle_client(Client);
config::Config
*_conf; ///> Pointer to the configuration class (with all config in)

View File

@ -6,11 +6,12 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/11 13:29:21 by mmoussou #+# #+# */
/* Updated: 2025/04/13 11:24:52 by mmoussou ### ########.fr */
/* Updated: 2025/04/14 14:25:35 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <sys/types.h>
#ifndef __WEBSERV_WEBSERV_HPP__
# define __WEBSERV_WEBSERV_HPP__