You have not provided any details beyond "it does not work", so you will probably get vague answers.

Your TCP code suffers from the same problems as your UDP code, which I pointed out in your other thread: strange global variables such as "a" and "img_block" are being modified all over the place, the "y" counter in a for loop is modified inside the body of the loop, etc. Maybe you got it working on UDP, but I wonder how maintainable it is.

Here is one new problem in your TCP code: you seem to assume that after you call socket->write(buffer) in the client, the server receives all this data, and only it, as one nice block, which you can read with socket->readAll(). That is not how TCP works. I strongly suggest you read http://blog.stephencleary.com/2009/0...e-framing.html to understand the problem.