summaryrefslogtreecommitdiff
path: root/client-qt/udm-client-qt/client_session.h
diff options
context:
space:
mode:
Diffstat (limited to 'client-qt/udm-client-qt/client_session.h')
-rw-r--r--client-qt/udm-client-qt/client_session.h11
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_;