fix(libSceNet): report a stream whose peer closed as readable on Windows #5376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5376"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-13T18:20:07Z.
What
When the peer of a stream socket closes, Winsock's
WSAPollreportsPOLLHUPwithoutPOLLRDNORM, whether or not the socket's own sending side is shut down.sceNetEpollWaitpassed that on, so on Windows a socket whose peer had closed came back asSCE_NET_EPOLLHUPalone and never as readable. A loop that waits forSCE_NET_EPOLLINto read the end of the stream never got it, while every wait returned at once.FreeBSD's
sopoll_genericreports a socket that can receive no more as readable, and addsPOLLHUPonly once it can send no more either. Linux'spolldoes the same, sosceNetEpollWaitalready reported it this way on Linux.On Windows, a stream socket's
POLLHUPwithoutPOLLERRnow reportsPOLLRDNORMwhen reading was asked for. It keepsPOLLHUPonly aftersceNetShutdownhas shut the socket's own sending side, which libSceNet now records.Unchanged:
POLLHUPwithPOLLERR) keeps the flagsWSAPollreports.sceNetSocketAbortshuts the host socket down without being recorded as a shutdown.pollreports its own stream sockets the same way on Windows. #4903 adds the shutdown state that fix needs, so it will follow once #4903 lands.selectalready counts a hang-up as readable.No title is claimed.
Tested
On GitHub's runners from my fork, on
mainat18c438b10(run):-DANYPS5_ENABLE_SPIRV_TOOLS=ON.The new
CheckEpollClosedStreaminguest_sce_netchecks three states in order:sceNetEpollWaitreports exactlySCE_NET_EPOLLIN;SCE_NET_EPOLLIN | SCE_NET_EPOLLOUTwhen both are asked for;sceNetShutdownof the sending side, it reportsSCE_NET_EPOLLIN | SCE_NET_EPOLLHUP.Results:
main'sExport.cppthe test aborts. With the change,guest_sce_netpasses 20 runs in a row.guest_sce_netpasses withmain's code and, 20 runs in a row, with the change.core/libs/prx/libcandcore/libs/prx/libkernelpasses: 69 and 124 on Linux, 90 and 127 on Windows.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:27:59Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed