#ifndef PCAPRETHREAD_H #define PCAPRETHREAD_H #include "waitingdlg.h" #include "pcap.h" #include typedef std::function FuncIntByte; struct PcapResp { FuncIntByte callback; int id; qint64 timeout; bool notCancelled{true}; }; class PcapReThread : public QThread { Q_OBJECT public: explicit PcapReThread(pcap *pcap); ~PcapReThread(); int sendMsgNet(const byte *msg, int size, int id, qint64 timeout, FuncIntByte callback, WaitingDlg *waitingDlg = 0); std::atomic status{0}; QList resps; std::mutex mtx; pcap *pcap; signals: void onMsg(FuncIntByte callback, int code, const QByteArray data); void onError(char *); protected: void run(); }; #endif // PCAPRETHREAD_H