Template
1
0

Fix for adding boilerplate

This commit is contained in:
2025-06-18 01:47:58 +03:00
parent a256404a3d
commit a607e4c99f
5 changed files with 129 additions and 0 deletions

34
src/HTTP.cpp Normal file
View File

@@ -0,0 +1,34 @@
#include "main.hpp"
void HTTPrequest::start() {
// Possible Logging here
readData();
}
void HTTPrequest::readData() {
std::shared_ptr<HTTPrequest> self(shared_from_this());
//
// Reading happens here
//
}
void HTTPrequest::processRequest(std::error_code ec, std::size_t size) {
//
// This is where we will process requests
//
}
void HTTPrequest::writeData(std::string data) {
//
// Response here
//
}
// ================= CLASS HANDLING SPECIFIC =================
HTTPrequest::HTTPrequest(asio::io_context &context) : sock(context) {}
asio::ip::tcp::socket &HTTPrequest::socket() { return sock; }
HTTPrequest::HTTPrequest_ptr HTTPrequest::create(asio::io_context &context) {
return HTTPrequest_ptr(new HTTPrequest(context));
}