In TCP data does not come in "messages". readyRead() is emitted whenever new data comes in. The number of readyRead() signals you receive doesn't matter, there is no data "attached" to it, at any moment in time calling readAll() on the socket will read all pending data. At the same time your data processing loop is probably invalid. I don't know what is the nature of your data but you should be prepared that it comes in multiple chunks (e.g. one octet each) so you should detect record boundaries yourself. Unless the receiver of your DataReceived() signal does that, you should do that before emitting the signal.
Bookmarks