network-experiment/bmrshared-web/lib/server.cpp

26 lines
983 B
C++

// GNU Lesser General Public License v3.0
// Copyright (c) 2025 Bart Beumer <bart@4beumer.nl>
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License v3.0 as published by
// the Free Software Foundation.
//
#include "internal_server.h"
#include <bmrshared/server.hpp>
using bmrshared::web::server;
using bmrshared::web::detail::internal_server;
server::server(boost::asio::io_context& io_context,
const boost::asio::ip::tcp::endpoint& listen_endpoint,
std::chrono::seconds incoming_request_timeout,
uint64_t request_body_limit,
unsigned int max_simultaneous_requests,
request_handler_interface& handler)
: m_internal(std::make_shared<internal_server>(io_context, listen_endpoint, incoming_request_timeout, request_body_limit, max_simultaneous_requests, handler))
{
m_internal->run();
}
server::~server() = default;