I work on a client program that uses select socket model for connections. When I set the socket to nonblocking mode and I want to connect I always get WSAEWOULDBLOCK error. If I try reconnecting I get the same error. What should I do to handle it?
This is the correct behaviour. WSAWOULDBLOCK isn't really an error, it's telling you that this would block if it was a blocking socket because it is busy doing something. Check your sockt(s) for writability they will be in that state once your connection succeeds.
I connect the socket, then I wait till its ready to write, and next time I go over the loop to process all the socket I get exception, and if I do WSAGetLastError() I get WSAEWOULDBLOCK.
Post the peice of code that causes this.