2020-08-08 11:44:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
2020-08-09 12:07:14 +00:00
|
|
|
#include <includes.h>
|
2020-08-13 03:35:22 +00:00
|
|
|
#include <httpflow.h>
|
2020-08-21 18:40:37 +00:00
|
|
|
#include <set>
|
2020-08-08 11:44:16 +00:00
|
|
|
|
|
|
|
class NetworkThread : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-08-09 12:07:14 +00:00
|
|
|
private:
|
2020-08-26 18:58:36 +00:00
|
|
|
std::set<std::string> received;
|
2020-08-13 03:35:22 +00:00
|
|
|
zmq::context_t context;
|
|
|
|
zmq::socket_t *socket;
|
2020-08-21 18:40:37 +00:00
|
|
|
std::set<std::string> accepted_flows;
|
2020-08-13 03:35:22 +00:00
|
|
|
void connect();
|
|
|
|
void disconnect();
|
|
|
|
void reconnect();
|
2020-08-08 11:44:16 +00:00
|
|
|
public:
|
|
|
|
explicit NetworkThread(QObject *parent = nullptr);
|
|
|
|
public slots:
|
|
|
|
void process();
|
|
|
|
signals:
|
|
|
|
void finished();
|
|
|
|
void error(QString err);
|
2020-08-13 03:35:22 +00:00
|
|
|
void httpMessage(http::Flow flow);
|
2020-08-08 11:44:16 +00:00
|
|
|
};
|