I changed the code for your code. no error. nothing wrong.
except, the speed remains slow...

I have a question:
maybe is it slow because I use two games at the same time to check the winsock?

Thank you,
Arie.