frikkasoft
13th December 2011, 12:19
I have a client which serializes a bunch of Qimages using QDatastream through QTcpSocket to a server for processing. Using similar code to which are in the Qt demo examples.
The binaries were compiled using Qt 4.6.3 (2010.04) and everything works great if the server runs on Qt 4.6.3 but if its run on Qt 4.7.0 (2010.05) the data which the server reads from the socket gets corrupt. It does not matter if the client and server are on the same machine using localhost.
The protocol I have is: [nrBytes, Qimage1], [nrBytes, Qimage2], ..., [nrBytes, QimageX] and at some random position the nrBytes will get corrupt and be an almost random value. nrBytes is a quint32 both on the client and server side.
I thought this was some bug in my code but after spending almost 5 days on debugging the code, involving several other programmers we can not see anything wrong. So I thought this was a hardware issue but after replacing almost all components this error still occurrs.
I then thought about binary compatibility but after reading Qt 4.7.0 changelog (http://qt.nokia.com/products/changes/changes-4.7.0) it says:
"The Qt version 4.7 series is binary compatible with the 4.6.x series. Applications compiled for 4.6 will continue to run with 4.7."
So I am quite stumped why the data gets corrupt since this should work, right?
The binaries were compiled using Qt 4.6.3 (2010.04) and everything works great if the server runs on Qt 4.6.3 but if its run on Qt 4.7.0 (2010.05) the data which the server reads from the socket gets corrupt. It does not matter if the client and server are on the same machine using localhost.
The protocol I have is: [nrBytes, Qimage1], [nrBytes, Qimage2], ..., [nrBytes, QimageX] and at some random position the nrBytes will get corrupt and be an almost random value. nrBytes is a quint32 both on the client and server side.
I thought this was some bug in my code but after spending almost 5 days on debugging the code, involving several other programmers we can not see anything wrong. So I thought this was a hardware issue but after replacing almost all components this error still occurrs.
I then thought about binary compatibility but after reading Qt 4.7.0 changelog (http://qt.nokia.com/products/changes/changes-4.7.0) it says:
"The Qt version 4.7 series is binary compatible with the 4.6.x series. Applications compiled for 4.6 will continue to run with 4.7."
So I am quite stumped why the data gets corrupt since this should work, right?