Skip to content
  • Daniel Vrátil's avatar
    Change they way commands are serialized into datastream · 439d28ec
    Daniel Vrátil authored
    Unfortunatelly QDataStream has no way of waiting for complete data to be
    available in the underlaying QIODevice, so we need to serialize the command
    in two levels: we serialize the entire command into a QByteArray and then
    we write the size of this QByteArray, followed by the data into the actual
    socket. By sending the size of the serialized data first we allow the deserialization
    code to ensure it reads the entire data (and waits for more if they are not
    available in the QIODevice at once).
    
    This fixes sending very large commands as well as sequences of commands at
    some cost to performance, but that's something we can look into optimizing
    later on.
    439d28ec