You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ptserver.h 708B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef PTSERVER_H
  2. #define PTSERVER_H
  3. #include "libptsocket_global.h"
  4. #include <QObject>
  5. #include <QTcpServer>
  6. #include <QTcpSocket>
  7. #include <QHostAddress>
  8. #include <QQueue>
  9. #include "ptsocket.h"
  10. class LIBPTSOCKETSHARED_EXPORT PTServer : public QTcpServer
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit PTServer(QObject *parent = 0);
  15. virtual PTSocket* nextPendingConnection();
  16. protected:
  17. virtual void incomingConnection(int handle);
  18. signals:
  19. void newClient(PTSocket*);
  20. public slots:
  21. private slots:
  22. void m_newConnection();
  23. void m_clientStateChanged(PTSocket::State s);
  24. private:
  25. QList<PTSocket*> m_tempClients;
  26. QList<PTSocket*> m_clients;
  27. QQueue<PTSocket*> m_incomings;
  28. };
  29. #endif // PTSERVER_H