How to read from a TCP socket (but were too afraid to ask)
incoherency.co.uk
incoherency.co.uk
A recurring theme was "I put an X byte message into a TCP connection and I have written the software at the other end with the assumption that all X bytes will arrive at the same time every time ..."
If the message is under 1500 bytes it usually works until it doesn't.