Fix for adding boilerplate
This commit is contained in:
34
src/HTTP.cpp
Normal file
34
src/HTTP.cpp
Normal 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));
|
||||
}
|
Reference in New Issue
Block a user