Skip to content

docs(debt): record what a Windows datagram socket keeps after sceNetConnect to AF_UNSPEC - #9651

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs/sce-net-connect-unspec-windows-bound-address
Oct 25, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs/sce-net-connect-unspec-windows-bound-address

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

The sceNetConnect to AF_UNSPEC entry in docs/dev/debt/libSceNet.md only described Linux. sceNetConnect dissolves a datagram association with disconnect_datagram (core/libs/prx/libSceNet/Export.cpp:1162, called at line 1204), which makes the same host calls in the same order as Disconnect in core/libs/prx/libkernel/Socket/src/Udp.cpp:315 (getpeername, getsockname, connect to an unspecified address, getsockname, and a bind to the wildcard address with the old port only when the port became 0). The entry now says that on Windows too a socket bound to an explicit address keeps it, that sceNetGetsockname reports that host address, and that a sendto on such a host socket to a non-loopback address fails with Winsock error 10051 where FreeBSD's udp_disconnect() resets the local address to the wildcard address.

Evidence

Same probe as #8921 (plain Winsock on Windows 10 Pro 19045): a socket bound implicitly by connect reports 0.0.0.0:<port> after connect(AF_UNSPEC) and the sendto succeeds; one explicitly bound to 127.0.0.1 stays on 127.0.0.1:<port> and the sendto fails with 10051. Measured on the host socket, not through sceNetSendto; not measured on a console. Found by reading disconnect_datagram, not from a title.

Tested

Docs only; python tools/check_conventions.py --base upstream/main passes.
Related: #8921.

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

AI-assisted (Claude Code).

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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 docs/dev/debt/libSceNet.md
PR 9727 docs/dev/debt/libSceNet.md
PR 9733 docs/dev/debt/libSceNet.md
PR 9932 docs/dev/debt/libSceNet.md
PR 9948 docs/dev/debt/libSceNet.md
PR 10502 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 debt update is consistent with the cited disconnect_datagram call path and the Windows host-socket probe. I also inspected the current debt entry and the #9106 edit: this is a documentation-line overlap only; #9106 changes Windows stream receive-timeout handling, while this PR records AF_UNSPEC behavior, so I do not see a shared runtime change to sequence. Two follow-ups before merge: - Please record the #9106 debt-line overlap in the PR discussion/checklist coordination if your branch has not already been reconciled with its updated line. - The evidence is explicitly a plain Winsock host probe, not a console measurement or a title stop. This PR says Unblocks: none; Validation: current-main python3 tools/check_conventions.py --base upstream/main passes; hosted eligibility, conventions, intake and labels checks pass. Product build/test jobs were skipped by the docs-only path filter, so no runtime test is claimed here.

I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

@github-actions github-actions Bot added docs needs rebase Conflicts with main, rebase needed labels Oct 22, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor

I’ve noticed that my earlier request to hold this PR based on #5239 was unnecessary. It’s fine to keep submitting PRs; maintainers will handle them in due course. Please disregard that request.

…onnect to AF_UNSPEC

sceNetConnect dissolves a datagram association with the same host call sequence as connect (disconnect_datagram in Export.cpp). The sceNetConnect-to-AF_UNSPEC debt entry only described Linux. On Windows a socket bound to an explicit address keeps it in the same way, and a sendto on the host socket to a non-loopback address fails with Winsock error 10051, where FreeBSD's udp_disconnect() resets the local address.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xXPBSXx
xXPBSXx force-pushed the docs/sce-net-connect-unspec-windows-bound-address branch from dba4984 to b2a6d79 Compare October 23, 2026 01:05
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@xXPBSXx

xXPBSXx commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX10 on the overlap with #9106: #9106 has been merged, and this branch is rebased onto current main (head b2a6d79), so the adjacent sceNetSetsockopt entry from #9106 is already in this branch and the conflict is gone. The two entries describe different behaviour.

AI-assisted (Claude Code).

@adriadam10 adriadam10 self-assigned this Oct 25, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 25, 2026 18:31

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@adriadam10
adriadam10 merged commit efe89d4 into boykopovar:main Oct 25, 2026
11 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the entry against disconnect_datagram (libSceNet/Export.cpp) and Disconnect in Udp.cpp: same host calls in the same order, and the wording keeps the host-measured and console-unmeasured limits explicit. The #9106 overlap is already reconciled on this head; merged.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants