summaryrefslogtreecommitdiff
path: root/http_connection.h
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-29 22:08:06 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-29 22:08:06 +0100
commit5d94fe647e59aaec7775f1e1bd4a4982b677af01 (patch)
treee459388b0d937bdb4034676c1a8276c59904fc68 /http_connection.h
parent2133fd579e0d4726b032288d10d053231109c586 (diff)
HTTPServer/HTTPConnection cleanup.
Diffstat (limited to 'http_connection.h')
-rw-r--r--http_connection.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/http_connection.h b/http_connection.h
new file mode 100644
index 0000000..f166f44
--- /dev/null
+++ b/http_connection.h
@@ -0,0 +1,26 @@
+#ifndef HTTP_CONNECTION_H
+#define HTTP_CONNECTION_H
+
+#include <boost/asio.hpp>
+#include <boost/enable_shared_from_this.hpp>
+using boost::asio::ip::tcp;
+
+namespace HTTP {
+ class Connection : public boost::enable_shared_from_this<Connection> {
+ friend class Server;
+
+ private:
+ Connection(boost::asio::io_service& io_service);
+ void handle_write(const boost::system::error_code& error, size_t bytes_transferred);
+ void handle_read(const boost::system::error_code& error, size_t bytes_transferred);
+ tcp::socket socket;
+ boost::asio::streambuf buf;
+
+ public:
+ typedef boost::shared_ptr<Connection> p;
+
+ void start();
+ };
+};
+
+#endif