-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Support failed async connects on windows. #930
Conversation
Please note that the correct way to do a non-blocking |
It would be awesome to get some traction on this, it has been half a year now |
Pinging this. |
The skipped tests causing failure were due to |
@michael-grunder , could we get this merged? |
I cherry-picked your commits to keep the git history clean. |
No problem. You can also ask me to rebase these PRs before merging, they've been lingering here for a long time and had Main merged in quite often. |
On Windows, a failed non-blocking connect() must be resolved by getting the socket error using getsockopt(). In fact, this
is the recommended way on posix too, not to repeat a call to connect(), but call getsockopt until it succeeds or fails.
This PR adds error translation to getsockopt(), adds an edge case for winsock (WSAEINVAL) and enables getsockopt() processing when connect() indicates that it is prudent.
This allows async connects to fail on windows with the proper error code.