Details
-
Suggestion
-
Resolution: Won't Do
-
P2: Important
-
None
-
6.7.0
-
None
Description
In case multiple messages arrive all together QTcpSocket::readAll() reads them all into a single QByteArray. Following the Qt protobuf/sensors example I have a meta-message consisting of a type id and a payload message of that type. Now MetaMessage::deserialize(QAbstractProtobufSerializer*, QByteArrayView) deserializes only the last MetaMessage from the composite QByteArray. And even if it deserialized the first message it seems there would be no means to know the number of bytes consumed and so no means to create a new QByteArrayView with the correct offset to deserialize the next message.
Also is it ok that in the generated code qRegisterProtobufTypes() is called in each serialize() and deserialize()? Wouldn't QAbstractProtobufSerializer()'s constructor be a better place?