I saw your fix, in the same file, in the same area... we can call it as we want....
1. a compilation issue
2. a matter of compliance with standards...
but at the end of the day it is a memory allocation problem causing wrong/erratic behaviour.
This does not solve the long file problem, which at the moment I "fixed" not using a delay, but replacing WSASend with a plain send. I do not know why the second works and the first one doesn't.
Thank you,
Maurizio