2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef SENDER_H
|
|
|
|
#define SENDER_H
|
|
|
|
|
2017-09-20 14:34:21 +00:00
|
|
|
#include <QtWidgets>
|
|
|
|
#include <QtNetwork>
|
|
|
|
#include <QtCore>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
class Sender : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-20 14:34:21 +00:00
|
|
|
explicit Sender(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void ttlChanged(int newTtl);
|
|
|
|
void startSending();
|
|
|
|
void sendDatagram();
|
|
|
|
|
|
|
|
private:
|
2017-09-20 14:34:21 +00:00
|
|
|
QLabel *statusLabel = nullptr;
|
|
|
|
QPushButton *startButton = nullptr;
|
2017-12-12 21:55:32 +00:00
|
|
|
QUdpSocket udpSocket4;
|
|
|
|
QUdpSocket udpSocket6;
|
2017-09-20 14:34:21 +00:00
|
|
|
QTimer timer;
|
2017-12-12 21:55:32 +00:00
|
|
|
QHostAddress groupAddress4;
|
|
|
|
QHostAddress groupAddress6;
|
2017-09-20 14:34:21 +00:00
|
|
|
int messageNo = 1;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|