2021-04-11 06:10:22 +08:00
|
|
|
#ifndef TCPSERVER_H
|
|
|
|
#define TCPSERVER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTcpServer>
|
|
|
|
#include <QTcpSocket>
|
|
|
|
|
|
|
|
class TCPServer : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
TCPServer(int port);
|
|
|
|
|
2021-04-11 18:33:37 +08:00
|
|
|
|
2021-04-11 06:10:22 +08:00
|
|
|
public slots:
|
|
|
|
bool send(QString line);
|
|
|
|
signals:
|
|
|
|
void received(QString line);
|
|
|
|
private:
|
|
|
|
QTcpServer server;
|
|
|
|
QTcpSocket *socket;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TCPSERVER_H
|