CCIMXDesktop
 
Loading...
Searching...
No Matches
Pinger.h
1#ifndef PINGER_H
2#define PINGER_H
3#include <QHostAddress>
4#include <QWidget>
5class QTcpSocket;
6class QElapsedTimer;
7class QHostInfo;
8namespace Ui {
9class Pinger;
10}
11
17class Pinger : public QWidget {
18 Q_OBJECT
22 static constexpr const unsigned int IS_TIMEOUT = 1000;
26 static constexpr const unsigned int PING_FREQ_PERIOD = IS_TIMEOUT;
27
28public:
33 explicit Pinger(QWidget* parent = nullptr);
34 ~Pinger();
35private slots:
36 void resolveHost();
37 void on_connected();
38 void on_connectionTimeout();
39
40private:
41 Ui::Pinger* ui;
42 QTcpSocket* socket;
43 QElapsedTimer* elapsed_timer;
44 QTimer* pingTimer;
45 QTimer* timeoutTimer;
46 QHostAddress targetAddress;
47 bool do_ping { false };
48 void setup_memory();
49 void performPing();
50 void abortPing();
51 void onHostResolved(const QHostInfo& host);
52};
53
54#endif // PINGER_H
The Pinger class holds the ping sessions, now it owns the display issue and processing issues at one ...
Definition Pinger.h:17