11 #ifndef HTTP_SERVER4_SERVER_HPP 12 #define HTTP_SERVER4_SERVER_HPP 16 #include <boost/array.hpp> 17 #include <boost/function.hpp> 18 #include <boost/shared_ptr.hpp> 34 const std::string& address,
const std::string& port,
35 boost::function<
void(
const request&,
reply&)> request_handler);
40 std::size_t length = 0);
46 boost::function<void(const request&, reply&)> request_handler_;
49 boost::shared_ptr<tcp::acceptor> acceptor_;
52 boost::shared_ptr<tcp::socket> socket_;
55 boost::shared_ptr<boost::array<char, 8192> > buffer_;
58 boost::shared_ptr<request> request_;
61 boost::tribool valid_request_;
67 boost::shared_ptr<reply> reply_;
73 #endif // HTTP_SERVER4_SERVER_HPP Provides core I/O functionality.
Encapsulates the flags needed for TCP.
Provides support for implementing stackless coroutines.
A request received from a client.
server(asio::io_service &io_service, const std::string &address, const std::string &port, boost::function< void(const request &, reply &)> request_handler)
Parser for incoming requests.
Class to represent an error code value.
A reply to be sent to a client.
void operator()(asio::error_code ec=asio::error_code(), std::size_t length=0)
Perform work associated with the server.
The top-level coroutine of the HTTP server.