TCP Socket how to know when all data has been received

Since no one has bothered to reply to this guy yet

This is where you need a “protocol”
A way to say “here comes some some data & here’s how much data to expect”
Or a way to send it with a “START OF DATA” marker and an “END OF DATA” marker
You need some way to know on the receivers side when you have ALL the data that was sent
Otherwise all you have is a conduit that is open that data can flow across and you have no way to know if you got all the data or not, where it might start and stop, etc