diff options
Diffstat (limited to 'client-qt/udm-client-qt/client_session.h')
-rw-r--r-- | client-qt/udm-client-qt/client_session.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/client-qt/udm-client-qt/client_session.h b/client-qt/udm-client-qt/client_session.h new file mode 100644 index 0000000..0e90d8a --- /dev/null +++ b/client-qt/udm-client-qt/client_session.h @@ -0,0 +1,33 @@ +#ifndef CLIENT_SESSION_H +#define CLIENT_SESSION_H + + +//boost.asio here, yes i know about qtnetwork, but i have more exp with boost asio + +#include <boost/asio.hpp> +#include <QObject> + + + +using boost::asio::ip::tcp; + +class client_session : public QObject +{ + Q_OBJECT +public: + explicit client_session(QObject *parent = 0, boost::asio::io_service *io_service = nullptr); + + tcp::socket& socket(); + +signals: + +public slots: + void connect(std::string &host, int port); +private: + void connect_handler(const boost::system::error_code &error); + char *recv_data_; + boost::asio::io_service &io_service_; + tcp::socket socket_; +}; + +#endif // CLIENT_SESSION_H |