1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

更新标准数据协议

This commit is contained in:
tianduanrui 2020-03-21 17:47:44 +08:00
parent bcf49cd964
commit d8c4ee93ac

View File

@ -22,14 +22,25 @@ public:
virtual void sendMessage ( const QQtDataSerialization& data ) { virtual void sendMessage ( const QQtDataSerialization& data ) {
//已经序列化好buffer //已经序列化好buffer
QByteArray bytes = data.buffer(); #if 0
QQtDataSerialization ds0 = data;
ds0.serialize(); //数据本地化,补充一次序列化。
#else
const QQtDataSerialization& ds0 = data;
#endif
QByteArray bytes = ds0.buffer();
write ( bytes ); write ( bytes );
} }
virtual void recvMessage ( const QQtDataSerialization& data ) { virtual void recvMessage ( const QQtDataSerialization& data ) {
//已经反序列化好buffer //已经反序列化好buffer
emit notifyToProtocolManager ( this, &data );
emit readyRead ( data );
} }
signals:
void readyRead ( const QQtDataSerialization& data );
protected: protected:
private: private: