#pragma once #include "LatencyTest.hpp" #include #include #include namespace uvw { class Loop; class TimerHandle; } namespace Qv2ray::components::latency { class LatencyTestThread : public QThread { Q_OBJECT public: explicit LatencyTestThread(QObject *parent = nullptr); void stopLatencyTest() { isStop = true; } void pushRequest(const QList &ids, int totalTestCount, Qv2rayLatencyTestingMethod method); void pushRequest(const ConnectionId &id, int totalTestCount, Qv2rayLatencyTestingMethod method); protected: void run() override; private: std::shared_ptr loop; bool isStop = false; std::shared_ptr stopTimer; std::vector requests; std::mutex m; // static LatencyTestResult TestLatency_p(const ConnectionId &id, const int count); }; } // namespace Qv2ray::components::latency