First I am sending the requested file from the server to the client and after that I want to send the computed sha of the file from the server to the client, so that the cli
You should redesign a bit how your app works:
A TCP stream needs to be formatted in both ends, since it is a stream not packets. I suppose you could look for a nullbyte ('\x00'
) which should signal end of file.