This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
short-link-backend/includes/http_server.hpp
2024-10-25 10:35:05 +02:00

24 lines
No EOL
578 B
C++

#ifndef HTTP_SERVER_HPP
#define HTTP_SERVER_HPP
#include "http_connection.hpp"
#include <boost/asio.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/system/detail/error_code.hpp>
using namespace boost::asio;
class HttpServer {
public:
HttpServer(io_context& io_context, const ip::tcp::endpoint& endpoint);
private:
io_context& io_context_;
ip::tcp::acceptor acceptor_;
void accept_connection();
void handle_accept(HttpConnection::pointer& new_connection, const boost::system::error_code& error_code);
};
#endif