tcpserver.h 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef TCPSERVER_H
  2. #define TCPSERVER_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 <QJsonDocument>
  12. #include <QJsonObject>
  13. #include <QJsonValue>
  14. #include <QJsonArray>
  15. #include <QJsonParseError>
  16. #include <QVariant>
  17. class TcpServer : public QObject
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit TcpServer(QObject *parent = nullptr);
  22. void start();
  23. void app_info(QString url,QString key,QString signature);
  24. signals:
  25. void tcp_log(QString log);
  26. public slots:
  27. void new_incomming();
  28. void read_data();
  29. void finishedSlot(QNetworkReply *reply);
  30. private:
  31. QTcpServer *svr;
  32. QTcpSocket *so;
  33. QNetworkAccessManager *networkManager;
  34. QSslConfiguration config;
  35. QString url, key, signature;
  36. };
  37. #endif // TCPSERVER_H