#ifndef BOB_H__ #define BOB_H__ #include #include #include #include #include "Streaming.h" namespace i2p { namespace client { class BOBDataStream: public std::enable_shared_from_this { public: BOBDataStream (std::shared_ptr socket, std::shared_ptr stream); private: std::shared_ptr m_Socket; std::shared_ptr m_Stream; }; class BOBCommandChannel { public: BOBCommandChannel (int port); ~BOBCommandChannel (); void Start (); void Stop (); private: void Run (); void Accept (); void HandleAccept(const boost::system::error_code& ecode, std::shared_ptr socket); private: bool m_IsRunning; std::thread * m_Thread; boost::asio::io_service m_Service; boost::asio::ip::tcp::acceptor m_Acceptor; std::list > m_DataStreams; }; } } #endif