123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef PTSERVER_H
- #define PTSERVER_H
-
- #include "libptsocket_global.h"
- #include <QObject>
- #include <QTcpServer>
- #include <QTcpSocket>
- #include <QHostAddress>
- #include <QQueue>
- #include "ptsocket.h"
-
- class LIBPTSOCKETSHARED_EXPORT PTServer : public QTcpServer
- {
- Q_OBJECT
- public:
- explicit PTServer(QObject *parent = 0);
- virtual PTSocket* nextPendingConnection();
- QList<PTSocket*> getClients() const;
-
- protected:
- virtual void incomingConnection(int handle);
-
- signals:
- void newClient(PTSocket*);
-
- public slots:
-
- private slots:
- void m_newConnection();
- void m_clientStateChanged(PTSocket::State s);
-
- private:
- QList<PTSocket*> m_tempClients;
- QList<PTSocket*> m_clients;
- QQueue<PTSocket*> m_incomings;
-
- };
-
- #endif // PTSERVER_H
|