-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocketclient.h
44 lines (35 loc) · 899 Bytes
/
socketclient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SOCKETCLIENT_H
#define SOCKETCLIENT_H
/* kccistc embedded & iot by ksh */
#include <QTcpSocket>
#include <QHostAddress>
#include <QInputDialog>
#include <QMessageBox>
#include <QDebug>
#define BLOCK_SIZE 1024
class SocketClient : public QWidget
{
Q_OBJECT
private:
QTcpSocket *pQTcpSocket;
QString SERVERIP = "10.10.14.57";
int SERVERPOT = 5000;
QString LOGID = "SCM_QT";
QString LOGPW = "PASSWD";
public:
// QTcpSocket *pQTcpSocket;
SocketClient(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~SocketClient();
QTcpSocket * getpQTcpSocket();
signals:
void sigSocketRecv(QString);
private slots:
void slotSocketReadData();
void slotSocketError();
void slotConnectServer();
public slots:
void slotConnectToServer(bool&);
void slotClosedByServer();
void slotSocketSendData(QString);
};
#endif // SOCKETCLIENT_H