| 123456789101112131415161718192021222324252627282930313233 |
- #ifndef PQ_PQTCPSOCKET_H
- #define PQ_PQTCPSOCKET_H
- #include <QTcpSocket>
- #include "pqmsgheader.h"
- /**
- 处理分包soket封装
- */
- namespace PQ {
- class PQTcpSocket : public QTcpSocket
- {
- Q_OBJECT
- public:
- explicit PQTcpSocket(QObject *parent = Q_NULLPTR);
- ~PQTcpSocket();
- public slots:
- // 写心消息
- void writeMessage(MSGHeader header, const QByteArray & byte);
- signals:
- void revicedMSG(const MSGHeader & header, QByteArray body);
- private slots:
- void msgError();
- void readSocketData();
- private:
- MSGRead _msg;
- };
- }
- #endif // PQTCPSOCKET_H
|