Skip to content
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

Nonblocking connect using poll #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ericonr
Copy link
Contributor

@ericonr ericonr commented Dec 3, 2024

Replacing #210

ericonr and others added 2 commits November 6, 2024 15:58
Use poll as a reasonably portable implementation. This takes advantage
of the existing FAKE_POLL implementation as well.

getsockopt(SO_ERROR) on Windows uses "int", removing the requirement for
any custom code for that platform.

We don't add any handling for EINTR, since it would add considerably
more code, and the connection can simply be retried. For that reason,
poll returning -1 is always an error.
@ericonr ericonr force-pushed the nonblocking-connect-poll branch from f1a6f5e to f44ddc8 Compare December 3, 2024 15:36
Comment on lines +535 to +536
pasynManager->getAutoConnectTimeout(&connectTimeout);
msConnectTimeout = 1000 * connectTimeout;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to note, which I don't know if it's relevant, is that any timeouts below 1ms will be rounded down to 0, causing poll to return immediately.

I don't think anyone actually would have such strict timeout requirements, though.

@AppVeyorBot
Copy link

Build asyn 1.0.283 failed (commit ae16b99eb5 by @ericonr)

@ericonr
Copy link
Contributor Author

ericonr commented Dec 3, 2024

@AppVeyorBot
Copy link

Build asyn 1.0.284 failed (commit b8bbe39652 by @ericonr)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants