forked from DragonPang/QtMultiThreadTcpServer
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserverthread.h
More file actions
41 lines (30 loc) Β· 821 Bytes
/
serverthread.h
File metadata and controls
41 lines (30 loc) Β· 821 Bytes
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
#ifndef SERVERTHREAD_H
#define SERVERTHREAD_H
#include <QThread>
#include <QObject>
#include <QtNetwork>
#include <QDebug>
#include "mysocket.h"
class Socket;
class serverThread : public QThread
{
Q_OBJECT
public:
serverThread(int sockDesc, QObject *parent = Q_NULLPTR);
~serverThread();
private:
void run(void);
public slots:
void sendDataSlot(int sockDesc, const QByteArray &data);
signals:
void dataReady(const QString &ip, const QByteArray &data);
void sendData(int sockDesc, const QByteArray &data);
void disconnectTCP(int sockDesc);
private slots:
void recvDataSlot(const QString &ip, const QByteArray &data);
void disconnectToHost(void);
private:
MySocket *m_socket;
int m_sockDesc;
};
#endif // SERVERTHREAD_H