2019-09-29 05:13:01 +00:00
|
|
|
|
#ifndef FRMTCPSERVER_H
|
|
|
|
|
#define FRMTCPSERVER_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include "tcpserver.h"
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class frmTcpServer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class frmTcpServer : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit frmTcpServer(QWidget *parent = 0);
|
|
|
|
|
~frmTcpServer();
|
|
|
|
|
|
|
|
|
|
private:
|
2021-01-24 08:04:48 +00:00
|
|
|
|
Ui::frmTcpServer *ui;
|
2019-09-29 05:13:01 +00:00
|
|
|
|
|
|
|
|
|
bool isOk;
|
2021-01-24 08:04:48 +00:00
|
|
|
|
TcpServer *server;
|
2019-09-29 05:13:01 +00:00
|
|
|
|
QTimer *timer;
|
|
|
|
|
|
|
|
|
|
private slots:
|
2021-01-24 08:04:48 +00:00
|
|
|
|
void initForm();
|
2019-09-29 05:13:01 +00:00
|
|
|
|
void initConfig();
|
|
|
|
|
void saveConfig();
|
2019-12-05 08:01:43 +00:00
|
|
|
|
void changeTimer();
|
2019-09-29 05:13:01 +00:00
|
|
|
|
void append(int type, const QString &data, bool clear = false);
|
|
|
|
|
|
2021-01-24 08:04:48 +00:00
|
|
|
|
private slots:
|
2019-09-29 05:13:01 +00:00
|
|
|
|
void clientConnected(const QString &ip, int port);
|
|
|
|
|
void clientDisconnected(const QString &ip, int port);
|
|
|
|
|
void sendData(const QString &ip, int port, const QString &data);
|
2021-01-24 08:04:48 +00:00
|
|
|
|
void receiveData(const QString &ip, int port, const QString &data);
|
2019-09-29 05:13:01 +00:00
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void on_btnListen_clicked();
|
|
|
|
|
void on_btnSave_clicked();
|
|
|
|
|
void on_btnClear_clicked();
|
|
|
|
|
void on_btnSend_clicked();
|
|
|
|
|
void on_btnClose_clicked();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // FRMTCPSERVER_H
|