1234567891011121314151617181920212223242526272829303132 |
- #ifndef PTSOCKET_H
- #define PTSOCKET_H
-
- #include "libptsocket_global.h"
- #include <QObject>
- #include <QTcpSocket>
- #include <QTimer>
-
- class LIBPTSOCKETSHARED_EXPORT PTSocket : public QTcpSocket
- {
- Q_OBJECT
- public:
- PTSocket(QObject* p);
- int getTimeout() const;
-
- static QByteArray handshakeData() const;
-
- public slots:
- void handshake();
- void setTimeout(int t);
-
- private slots:
- void m_readyRead();
- void m_handshakeError();
-
- private:
- bool m_hasHandshaked;
- QTimer m_timeoutTimer;
- int m_timeout;
- };
-
- #endif // PTSOCKET_H
|