mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 11:20:49 +08:00
29 lines
658 B
C++
29 lines
658 B
C++
#pragma once
|
|
#include <QtGlobal>
|
|
#ifdef Q_OS_UNIX
|
|
#include <QPair>
|
|
#include <QString>
|
|
namespace Qv2ray::components::latency::icmping
|
|
{
|
|
class ICMPPing
|
|
{
|
|
public:
|
|
explicit ICMPPing(int ttl);
|
|
~ICMPPing()
|
|
{
|
|
deinit();
|
|
}
|
|
QPair<int64_t, QString> ping(const QString &address);
|
|
|
|
private:
|
|
void deinit();
|
|
// number incremented with every echo request packet send
|
|
unsigned short seq = 1;
|
|
// socket
|
|
int socketId = -1;
|
|
bool initialized = false;
|
|
QString initErrorMessage;
|
|
};
|
|
} // namespace Qv2ray::components::latency::icmping
|
|
#endif
|