Increased TCP buffer size to 10kB
Added missing header files; change the min function to fmin()
Replaced strlen with the actual size value