Despite this, it sometimes causes the server-side to crash. I use a proper method of checking the number of bytes sent, delaying and re-sending, shown in the line of code below. If further data cannot be sent from the server to the client, then I stop sending data and instead end the thread gracefully. The mechanism used for this is at viewtopic.php?p=328229#p328229
Code: Select all
result.i = SendNetworkString(clientid.i, senddata.s, #PB_Unicode)
The crash never happens when the debugger is being used, making it difficult for me to find the cause. It also doesn't appear to happen if I add a 1ms delay to the sending of data segments, but when I compile the server-side code and run it normally, then I sometimes see this problem. I see only the following.
"A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."
Should I be able to make use of OnErrorCall(@ErrorHandler()) that I saw on the forum a few days ago? Looking at the documentation, I'm not sure what kind of error it is intended to trap, as it only says "Changes the action taken if an error occurs ". Is it referring to this type of crash? Any suggestions appreciated.