mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
refactor: Coroutine based webserver (#1699)
Code of new coroutine-based web server. The new server is not connected to Clio and not ready to use yet. For #919.
This commit is contained in:
@@ -21,9 +21,11 @@
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/beast/http/message.hpp>
|
||||
#include <boost/beast/http/string_body.hpp>
|
||||
|
||||
#include <expected>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@@ -44,6 +46,15 @@ public:
|
||||
*/
|
||||
TestHttpServer(boost::asio::io_context& context, std::string host);
|
||||
|
||||
/**
|
||||
* @brief Accept a new connection
|
||||
*
|
||||
* @param yield boost::asio::yield_context to use for networking
|
||||
* @return Either a socket with the new connection or an error code
|
||||
*/
|
||||
std::expected<boost::asio::ip::tcp::socket, boost::system::error_code>
|
||||
accept(boost::asio::yield_context yield);
|
||||
|
||||
/**
|
||||
* @brief Start the server
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user