I have a Windows server app which does
- WSAStartup(), obviously
- listen() on TCP port X
- accept() an incoming connection
- ioctlsocket() the socket into nonblocking mode
- try to reply with WSASendMsg
I receive WSAEINVAL error code, which supposedly means: 'The socket has not been bound with bind, or the socket was not created with the overlapped flag.'
In this case it makes no sense to call bind(), since the socket is already connected with local and remote addresses. And the socket was definitely not created with the overlapped flag either.
So what is the real reason I get the error that escaped that line of documentation?