Skip to content

soc_poll: don't sleep out the timeout when a connect completes or fails - #610

Closed
Migushthe2nd wants to merge 1 commit into
devkitPro:masterfrom
Migushthe2nd:fix/soc-poll-pollout
Closed

Migushthe2nd wants to merge 1 commit into
devkitPro:masterfrom
Migushthe2nd:fix/soc-poll-pollout

Conversation

@Migushthe2nd

@Migushthe2nd Migushthe2nd commented Oct 13, 2026 •

Copy link
Copy Markdown

LLM-generated content removed

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.
@fincs fincs closed this Oct 13, 2026
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