Repository navigation
fix(net): implement SO_ERROR for connection completion - #2182
Closed
RockYou-cmd wants to merge 1 commit into
Closed
RockYou-cmd wants to merge 1 commit into
RockYou-cmd wants to merge 1 commit into
Conversation
8 of 9 tasks
This was referenced Oct 9, 2026
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
This was referenced Oct 9, 2026
Collaborator
|
Closing: no title is shown querying |
9 tasks done
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.
What
sceNetGetsockoptrejects SO_ERROR, so a caller waiting for a nonblocking connection cannot query its completion result. Implement guest SO_ERROR (0x1007), translate the host socket error to guest errno, return the output size, and preserve thread errno on successful queries.On Windows 10 build 19045.7417, Winsock returns WSAECONNREFUSED repeatedly after a failed asynchronous connection. Track the consumed completion error per native socket, serialize connect/error queries, and reset it when another connection attempt starts. Successful connections stop this tracking once getpeername confirms a peer. Established-socket and UDP errors continue to use host behaviour.
The regression covers successful and refused loopback connections, invalid query arguments, output bounds, errno preservation, receive EAGAIN, and Windows same-socket retries with concurrent readers. The pending-connect errno mapping is already provided by merged #1448 and is not reintroduced here. FreeBSD-derived guest behaviour and unverified console semantics are recorded in TechnicalDebt.
Overlap review: 456 open PR titles/bodies checked, with diffs inspected for the open libSceNet changes. #1786 extends the same host-error mapping and #1588 changes the global synchronization used by the same exports; neither implements SO_ERROR. Resolver and pool-statistics changes have since merged and are preserved in the final rebase. No dependency on an unmerged PR.
Tested
Candidate Windows validation and final rebase:
f145139676a48306681d3a4d5fabf83938759daf: both networking targets compiled andguest_sce_netplusguest_sce_net_connecteach passed three CTest repetitions (six executions, 0 failures, 12.85 seconds). This uses the project guest ABI.51f69aa2182f28ef3b91cdc20e57431d065e3e65preserves the same SO_ERROR implementation and tests, incorporates upstream resolver/pool-statistics changes, and resolves the TechnicalDebt conflict while retaining upstream entries. The macOS isolated loopback regression passed after this rebase. Windows/Linux integration on this final base remains pending maintainer-triggered CI; the earlier Windows run is not presented as a final-head result. Upstream Build run 37919912528 is action_required with no jobs started. The conventions check passed.b7a6823f. Diff and repository conventions checks passed.Earlier Windows validation on
df16c4c256be3c44e03eb9149a6ce5f8e8a038b2, before narrowing the patch for current main:guest_sce_netand newguest_sce_net_connectpassed three repetitions, including Windows refusal clearing, concurrent readers and successful same-socket retry.agc_driver_sdwa_float_selectors,agc_driver_sdwa_ldexp_f16, andguest_system_fontfailed. Temporarily removing the patch and rebuilding reproduced all three failures on the same upstream revision and machine. The two graphics mismatch values were identical; the font test ended at the same point in its output. Restoring the patch and rebuilding made both networking tests pass again.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)