How avoid TCP packet fragmentation?
I suspect its stream.print() that is causing the problem.  Write the data into a string and then use a SINGLE call to stream.print() to send the data.  It looks like it is trying to send it as soon as possible to prevent delays and this is what is causing fragmentation..