I’m trying to get select to work right and it seems to be returning 1 even when there is nothing to be read on the socket. So I end up calling recv and it blocks because nothing is there to read.
Also annoying is the fact that with winsock it is necessary to call FD_SET each time select is called, which isn’t consistent with standard implementations.
Are there any other weird quirks I need to be aware of?
I fixed it but I cannot determine what exactly the cause of the problem was. I do know that it is very relevant that
FD_SETmust be used to re-set the set for eachselect()call. According to the documentation, after callingselectit fills in the sets which are ready for read/write/etc.Moral of the story today is: read the documentation.