From 0e7f2cef26bde782a5758b5e9a3dfe20f745df8f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Fri, 31 Dec 2010 01:25:38 +0100 Subject: Added an echoing telnet server as a base for a telnet command interface. --- telnet_connection.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 telnet_connection.h (limited to 'telnet_connection.h') 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 +#include + +using boost::asio::ip::tcp; + +namespace telnet { + class Connection : public boost::enable_shared_from_this { + 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 p; + + void start(); + }; +}; + +#endif -- cgit v1.2.3