Skip to content

feat(libSceNet): expose socket type and listen state - #9525

Open
Queuse wants to merge 4 commits into
boykopovar:mainfrom
Queuse:codex/net-socket-state
Open

Queuse wants to merge 4 commits into
boykopovar:mainfrom
Queuse:codex/net-socket-state

Conversation

@Queuse

@Queuse Queuse commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement SO_TYPE and SO_ACCEPTCONN queries in sceNetGetsockopt using the guest socket type and listening state. Readback follows FreeBSD 11.4 sogetopt: listening returns bit 2, and short output buffers are truncated. Unverified console and pointer behavior remain in library debt.

Tested

Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head a2cd79cd2b includes main 097a9514a0.

  • Rebuilt the affected libraries and focused test targets. guest_net_socket_state: 1/1 pass, with no skips.
  • Conventions and whitespace checks pass. Trial integration with consulted main a23f8fc9fb is clean; runtime results remain tied to the included base 097a9514a0.

Merge order remains #9523 → #9542 → #9515 → #9578 and #9525 → #9543 → #9930 → #8686; #9931 follows #9542. #9930 and #9931 may land in either order after their prerequisites. The #9932/#9948 author agreed to follow #9930/#9931 and preserve both debt entries. Keep every getter path and test registration during integration.

The #6044 test-reorganization and #5836 peer-socket order proposals still await their authors. If #6044 lands first, move these tests to tests/networking and use add_library_test(networking ...). Manual checks of #7201/#8658/#9733 find separate resolver or send/host-platform paths; their existing base conflicts remain. No duplicated socket-option implementation was found in those inspected changes.

Earlier combined integration results cover eight network tests on Windows and WSL2 at tree c9c1293. Those results are separate from this revision's focused run. No fresh Linux/macOS, full hosted product build, title or console run is claimed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@MarcZX10 MarcZX10 mentioned this pull request Oct 22, 2026
12 tasks done

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation matches the documented FreeBSD 11.4 behavior for SO_TYPE and SO_ACCEPTCONN: it reads the tracked guest socket type/listen state, returns the flag bit, and truncates to the caller's output length. The author-reported Windows test covers IPv4/IPv6, UDP/TCP, listener/accepted state, short buffers and invalid descriptors. Current eligibility, conventions, intake, labels, and report checks pass; hosted product/relinker jobs are skipped. I did not run a local test. I also checked that this PR and #9523 merge together cleanly.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9932 docs/dev/debt/libSceNet.md L41-42

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5836 core/libs/prx/libSceNet/CMakeLists.txt
core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 9515 core/libs/prx/libSceNet/Export.cpp
PR 9578 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9727 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9733 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 9948 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 10502 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared , , and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in , and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation review and author-reported Windows test remain as noted in my earlier review, but the current overlap report changes the merge-readiness assessment. It now lists shared CMakeLists.txt, Export.cpp, and debt-file comparisons with #9523, #9542, #9543 and #9544, and shared paths with #9506; older conflicted-base comparisons remain unresolved as well. My earlier clean merge check with #9523 is not enough to clear the refreshed report. Please compare the exact hunks, coordinate landing order with affected authors where the rule applies, record any prerequisites in the Depends on checklist, and update the overlap report after resolving/rebasing. I’m requesting changes for the repository’s overlap/coordination requirement; I found no new behavior defect in this diff. Current policy checks pass; product jobs are skipped, and I did not rerun local tests.

@MarcZX10

Copy link
Copy Markdown
Contributor

Current-head recheck: sync is 1 ahead / 119 behind today’s main (base a6dcea927); individual merge, diff-check and conventions pass. Pairwise merges are clean with #9523, #9542, #9544 and #9506, and conflict in Export.cpp with #9543. #9543 already says it follows #9525, so that direction is appropriate; please retain the #9525 → #9543 order while reconciling the other live overlap notes and refresh this branch to current main. The Windows focused test remains author-reported; I did not rerun a local network build.

@Queuse

Queuse commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX10 refreshed this branch onto main b7d1d47a5 (head b957cf8b41). Conventions and whitespace checks pass, and the description separates earlier runtime results from the refreshed revision. The #9525 before #9543 order remains. I followed up with the authors of #6044 and #5836 and marked their ordering pending; I will not treat either proposal as agreed before they reply.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants