devinfotcpserver.h 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef DEVINFOTCPSERVER_H
  2. #define DEVINFOTCPSERVER_H
  3. #include <QObject>
  4. #include <QTcpServer>
  5. #include <QTcpSocket>
  6. #include <QDateTime>
  7. #include <QNetworkAccessManager>
  8. #include <QNetworkRequest>
  9. #include <QNetworkReply>
  10. #include <QSslConfiguration>
  11. #include <QVariant>
  12. #include <QJsonDocument>
  13. #include <QJsonObject>
  14. #include <QJsonValue>
  15. #include <QJsonArray>
  16. #include <QJsonParseError>
  17. #include <QCryptographicHash>
  18. class DevInfoTcpServer : public QObject
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit DevInfoTcpServer(QObject *parent = nullptr);
  23. void start();
  24. signals:
  25. void tcp_log(QString log);
  26. void append_sql(QString sql);
  27. public slots:
  28. void new_incomming();
  29. void read_data();
  30. void finishedSlot(QNetworkReply *reply);
  31. private:
  32. QTcpServer *svr;
  33. QTcpSocket *so;
  34. QNetworkAccessManager *networkManager;
  35. QSslConfiguration config;
  36. };
  37. #endif // DEVINFOTCPSERVER_H