Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-125244

QProtobufSerializer should be able to deserialize multiple messages from a single QByteArray.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P2: Important
    • None
    • 6.7.0
    • Protocol Buffers
    • None
    • All

    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?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tatiana.borisova Tatiana Borisova
            some_username Dmitriy Goncharov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes