tcpserver.h 877 B

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