summaryrefslogtreecommitdiff
path: root/telnet_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'telnet_connection.h')
-rw-r--r--telnet_connection.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/telnet_connection.h b/telnet_connection.h
new file mode 100644
index 0000000..8ea3cad
--- /dev/null
+++ b/telnet_connection.h
@@ -0,0 +1,26 @@
+#ifndef TELNET_CONNECTION_H
+#define TELNET_CONNECTION_H
+
+#include <boost/asio.hpp>
+#include <boost/enable_shared_from_this.hpp>
+
+using boost::asio::ip::tcp;
+
+namespace telnet {
+ class Connection : public boost::enable_shared_from_this<Connection> {
+ friend class Server;
+
+ private:
+ Connection(boost::asio::io_service& io_service);
+ 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