I had to put a Sleep() or the loop would use up all my cpu (90%). Also, by putting a Sleep() the winsock has time to retrieve the data from the server. Infact, without sleeping the function would return -1 all the time!
Printable View
I had to put a Sleep() or the loop would use up all my cpu (90%). Also, by putting a Sleep() the winsock has time to retrieve the data from the server. Infact, without sleeping the function would return -1 all the time!
That's because of the weird way you are retrieving data from your socket.
I cannot work out anything different so for the moment I'll be just happy with that