mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
更新标准数据协议
This commit is contained in:
parent
bcf49cd964
commit
d8c4ee93ac
@ -22,14 +22,25 @@ public:
|
||||
|
||||
virtual void sendMessage ( const QQtDataSerialization& data ) {
|
||||
//已经序列化好buffer
|
||||
QByteArray bytes = data.buffer();
|
||||
#if 0
|
||||
QQtDataSerialization ds0 = data;
|
||||
ds0.serialize(); //数据本地化,补充一次序列化。
|
||||
#else
|
||||
const QQtDataSerialization& ds0 = data;
|
||||
#endif
|
||||
QByteArray bytes = ds0.buffer();
|
||||
write ( bytes );
|
||||
}
|
||||
|
||||
virtual void recvMessage ( const QQtDataSerialization& data ) {
|
||||
//已经反序列化好buffer
|
||||
emit notifyToProtocolManager ( this, &data );
|
||||
emit readyRead ( data );
|
||||
}
|
||||
|
||||
|
||||
signals:
|
||||
void readyRead ( const QQtDataSerialization& data );
|
||||
protected:
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user