Receptacle
 All Classes Files Functions Variables Pages
client_connection.h
1 /*
2 
3 Copyright 2014 William Wedler
4 
5 This file is part of Receptacle
6 
7 Receptacle is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Receptacle is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License
18 along with Receptacle. If not, see <http://www.gnu.org/licenses/>.
19 
20 */
21 
22 
23 
24 // client_connection.h
25 
26 #ifndef CLIENT_CONNECION_H
27 #define CLIENT_CONNECTION_H
28 
29 #include <QObject>
30 #include <QTcpSocket>
31 #include <QThreadPool>
32 #include <QDebug>
33 
34 class ClientConnection : public QObject
35 {
36  Q_OBJECT
37 public:
38  explicit ClientConnection(QObject *parent = 0);
39  void setSocket(qintptr descriptor);
40 
41 signals:
42  void command_sent(QString commmand);
43 
44 public slots:
45  void connected();
46  void disconnected();
47  void readyRead();
48 
49  // make the server fully ascynchronous
50  // by doing time consuming task
51  void TaskResult(int Number);
52 
53 private:
54  QTcpSocket *socket;
55 
56 };
57 
58 #endif // CLIENT_CONNECTION_H
Definition: client_connection.h:34