1 #ifndef jb_ehs_connection_hpp 2 #define jb_ehs_connection_hpp 6 #include <beast/core/flat_buffer.hpp> 7 #include <boost/asio/ip/tcp.hpp> 8 #include <boost/asio/strand.hpp> 17 class connection :
public std::enable_shared_from_this<connection> {
29 socket_type&& sock, std::shared_ptr<request_dispatcher> dispatcher);
57 void on_read(boost::system::error_code
const& ec);
64 void on_write(boost::system::error_code
const& ec);
71 beast::flat_buffer
sb_;
80 #endif // jb_ehs_connection_hpp Handle one connection to the control server.
boost::asio::io_service::strand strand_
beast::http::request< beast::http::string_body > request_type
The request type used for JayBeams Embedded HTTP Servers.
void on_read(boost::system::error_code const &ec)
Handle a completed HTTP request read.
void on_write(boost::system::error_code const &ec)
Handle a completed response write.
void run()
Asynchronously read a HTTP request for this connection.
static std::atomic< int > idgen
boost::asio::ip::tcp::socket socket_type
The type of socket used for the connection.
connection(socket_type &&sock, std::shared_ptr< request_dispatcher > dispatcher)
Create a new connection.
std::shared_ptr< request_dispatcher > dispatcher_
connection & operator=(connection &&)=delete
The top-level namespace for the JayBeams library.