1234567891011121314151617181920212223242526272829 |
- #ifndef IOMANAGER_HPP
- #define IOMANAGER_HPP
- #include "global.hpp"
- #include <string>
- #include <boost/asio.hpp>
- using boost::asio::ip::tcp;
- class IoManager {
- protected:
- boost::asio::io_service ios;
- tcp::socket *tcpsock;
- boost::system::error_code errcode;
- std::string *ipstring;
- int port;
- public:
- // Basic constructor
- IoManager(char *ipcstring);
- // destructor to clean up all generic stuff
- ~IoManager();
- // enters loop to handle further interaction based on derived class
- virtual void run() = 0;
- // tries to establish connection, returns false on error
- bool connect();
- };
- #endif
|