My application (VB6) uses winsock with TCP/IP protocol to transfer large amount of data (1MBytes and up) to another system.
When receiving data using slow computer speed (like 1.7GHz with windows XP) - data is lost.
I payed attention that one DataArrival event "chases" another and the operation doesn't return to calling function (from DoEvents command) by program debugging.
When program runs on 3GHz PC the problem is less serious (1 of ~180 data receiving operation fails).
The goal is to create code which will work on any platform, no matter what is the computer speed.
I suspect that winsock is forced to handle with next 8KBytes (size of receive buffer) chunk before it resets internal receive buffer flag or clears buffer (be prepared for next packet).
If i insert DoEvents command in the end of DataArrival event sub the winsock succeed to perform these actions (the data receiving completed successfully), but the next event is fired from this command and so on and nesting is created. For large files "Stack out of space error" occurs, which terminates the transfer.
Am i right about understanding the socket receive process?
There is VB method or API commad of winsock to do this through code at the end of DataArrival event?
I appreciate any help.