#ifndef CONNECTION_H #define CONNECTION_H #include #include #include #include #include #include #include "protocol.h" #include "util.h" class connection : private boost::noncopyable { public: connection(boost::asio::io_service& ioService, const context& context); boost::asio::ip::tcp::socket& socket(); void start(); private: void start_read(); void handle_read(const boost::system::error_code& ec, std::size_t length); void start_write(const std::string& message); void handle_write(const boost::system::error_code& ec); boost::asio::io_service& m_ioService; boost::asio::ip::tcp::socket m_socket; boost::array m_data; protocol m_protocol; }; #endif // CONNECTION_H