2019-09-29 05:13:01 +00:00
|
|
|
|
#ifndef FRMUDPSERVER_H
|
|
|
|
|
#define FRMUDPSERVER_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QtNetwork>
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class frmUdpServer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class frmUdpServer : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit frmUdpServer(QWidget *parent = 0);
|
|
|
|
|
~frmUdpServer();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui::frmUdpServer *ui;
|
|
|
|
|
|
|
|
|
|
QUdpSocket *udpSocket;
|
|
|
|
|
QTimer *timer;
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void initForm();
|
2019-12-05 08:01:43 +00:00
|
|
|
|
void initIP();
|
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);
|
|
|
|
|
|
|
|
|
|
void readData();
|
|
|
|
|
void sendData(const QString &ip, int port, const QString &data);
|
2019-12-05 08:01:43 +00:00
|
|
|
|
void clientConnected(const QString &ip, int port);
|
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();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // FRMUDPSERVER_H
|