1 #ifndef CPP_WEB_SERVER_HTTP_CONNECTION_HPP
2 #define CPP_WEB_SERVER_HTTP_CONNECTION_HPP
8 #include <boost/asio.hpp>
9 #include <boost/enable_shared_from_this.hpp>
10 #include <boost/noncopyable.hpp>
11 #include <boost/shared_ptr.hpp>
12 #include <boost/thread/mutex.hpp>
34 class HttpConnection :
public boost::enable_shared_from_this<HttpConnection>,
35 private boost::noncopyable
38 typedef boost::function<void(
const char* begin,
const char* end)>
45 boost::asio::ip::tcp::socket&
socket();
62 void write(
const std::string&);
66 void write(
const std::vector<boost::asio::const_buffer>& buffer,
70 void handle_read(
const char* begin,
const char* end);
72 const boost::system::error_code& e,
73 std::size_t bytes_transferred);
79 std::vector<ResourcePtr> resources);