devinfotcpserver.h 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. void app_info(QString url,QString key,QString signature);
  25. signals:
  26. void tcp_log(QString log);
  27. void append_sql(QString sql);
  28. public slots:
  29. void new_incomming();
  30. void read_data();
  31. void finishedSlot(QNetworkReply *reply);
  32. private:
  33. QTcpServer *svr;
  34. QTcpSocket *so;
  35. QNetworkAccessManager *networkManager;
  36. QSslConfiguration config;
  37. QString url, key, signature;
  38. };
  39. #endif // DEVINFOTCPSERVER_H