Repository navigation
soc_poll: don't sleep out the timeout when a connect completes or fails - #610
Closed
Migushthe2nd wants to merge 1 commit into
Closed
Migushthe2nd wants to merge 1 commit into
Migushthe2nd wants to merge 1 commit into
Conversation
The SOC service doesn't wake a poll() waiting for POLLOUT when a non-blocking connect() completes, so poll() only returns once its timeout runs out (curl waits a second per new connection this way). It also reports a refused connection only as readable, so a POLLOUT waiter never learns about it. Wait for POLLOUT in 10 ms slices, and watch those sockets for POLLIN too: POLLIN without POLLOUT on a socket that then fails to receive is a failed connection, reported as POLLERR | POLLHUP. Nothing tells a socket that is still connecting from a connected one (getpeername() succeeds for both), so connected sockets waiting for POLLOUT are sliced as well. Waits for POLLIN alone are unchanged. Fixes the poll() part of devkitPro#412.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM-generated content removed