wscenter.h 726 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef WSCENTER_H
  2. #define WSCENTER_H
  3. #include <QObject>
  4. #include <QList>
  5. //#include <QtWebSockets/QWebSocket>
  6. //#include <QtWebSockets/QWebSocketServer>
  7. #include <QtNetwork/QSslError>
  8. #include "wsclient.h"
  9. QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
  10. QT_FORWARD_DECLARE_CLASS(QWebSocket)
  11. class WSCenter : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit WSCenter(QObject *parent = Q_NULLPTR);
  16. ~WSCenter();
  17. void checkLastNote(QString companyCode);
  18. signals:
  19. // void closed();
  20. public slots:
  21. void onNewConnection();
  22. void socketDisconnected();
  23. void onSslErrors(const QList<QSslError> &errors);
  24. private:
  25. QWebSocketServer *m_pWebSocketServer;
  26. QList<WSClient *> m_clients;
  27. };
  28. #endif // WSCENTER_H