diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-04 08:49:06 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-04 08:49:06 +0300 |
commit | 40de4ad32bf8d6b285903628dfc1bcfd0c1a708b (patch) | |
tree | c9fd7cea9e54e9f7b57c32919747b93ecd41b8cf /client-qt/udm-client-qt/client_session.h | |
parent | 6594e57c5084fb7199673e15cb39541e4750d0b1 (diff) |
server:
bits of log
client-qt:
implemented basic message dispatcher
ability to send message
(all untested)
Diffstat (limited to 'client-qt/udm-client-qt/client_session.h')
-rw-r--r-- | client-qt/udm-client-qt/client_session.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/client-qt/udm-client-qt/client_session.h b/client-qt/udm-client-qt/client_session.h index f13e96d..192d15b 100644 --- a/client-qt/udm-client-qt/client_session.h +++ b/client-qt/udm-client-qt/client_session.h @@ -27,11 +27,14 @@ #include <boost/asio.hpp> #include <QObject> +#include "../../protocol/udm.pb.h" using boost::asio::ip::tcp; +class server_msg; + class client_session : public QObject { Q_OBJECT @@ -42,12 +45,18 @@ public: tcp::socket& socket(); signals: + void client_connected(bool success, QString error_text); //we are in threads, no links here + void server_message_received(server_msg msg); //we are in threads, no links here public slots: void client_connect(QString host, int port); void run_io_service(); + void send_message(client_msg &msg); + private: - void connect_handler(const boost::system::error_code &error); + void handle_connect(const boost::system::error_code &error); + void handle_read(const boost::system::error_code& error, size_t bytes_transferred); + void handle_write(const boost::system::error_code& error); char *recv_data_; boost::asio::io_service &io_service_; tcp::socket socket_; |