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.

ptsocket.h 522B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef PTSOCKET_H
  2. #define PTSOCKET_H
  3. #include "libptsocket_global.h"
  4. #include <QObject>
  5. #include <QTcpSocket>
  6. #include <QTimer>
  7. class LIBPTSOCKETSHARED_EXPORT PTSocket : public QTcpSocket
  8. {
  9. Q_OBJECT
  10. public:
  11. PTSocket(QObject* p);
  12. int getTimeout() const;
  13. static QByteArray handshakeData() const;
  14. public slots:
  15. void handshake();
  16. void setTimeout(int t);
  17. private slots:
  18. void m_readyRead();
  19. void m_handshakeError();
  20. private:
  21. bool m_hasHandshaked;
  22. QTimer m_timeoutTimer;
  23. int m_timeout;
  24. };
  25. #endif // PTSOCKET_H