Repository navigation
fix(libSceNet): take 0x1105 and 0x1106 as the send and receive timeouts - #4610
Merged
adriadam10 merged 3 commits intoOct 13, 2026
Merged
Conversation
sceNetSetsockopt and sceNetGetsockopt answered EOPNOTSUPP for 0x1105 and 0x1106, the SCE send and receive timeouts in microseconds (shadPS4 net_types.h ORBIS_NET_SO_SNDTIMEO/RCVTIMEO, SharpProspero Socket.cs SoSndTimeo/SoRcvTimeo, KytyPS5 network.cpp). A title that set a receive timeout this way then blocked in sceNetRecv for good. Both options now set and read the timeouts that 0x1005 and 0x1006 already do.
boykopovar#4673 adds a function after receive_error, so defining timeout_option there made the two pull requests conflict.
10 tasks done
6 tasks done
10 tasks done
10 tasks done
…on apart from new neighbours boykopovar#4988 adds a constant after NET_SO_RCVTIMEO and boykopovar#4989 adds a function before receive_error, so defining the SCE timeout constants and timeout_option there made the pull requests conflict.
Collaborator
|
Checked on current |
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
sceNetSetsockoptandsceNetGetsockoptansweredEOPNOTSUPPfor 0x1105 and 0x1106, the SCE send and receive timeouts (an int in microseconds); only FreeBSD's 0x1005 and 0x1006 were known. A title that set a receive timeout this way lost it, and a latersceNetRecvon an idle socket blocked for good:mainsceNetSetsockopt(s, 0xffff, 0x1106, 200000)0x8041012d(errno 45)sceNetGetsockopt(s, 0xffff, 0x1106)0x8041012d(errno 45)sceNetSetsockopt/sceNetGetsockoptwith 0x1105sceNetRecvon an empty UDP socket afterwards0x80410123(EAGAIN) after 200 msBoth options now set and read the timeouts that 0x1005 and 0x1006 already do; 0x1005 and 0x1006 are unchanged.
Values: shadPS4 net_types.h (
ORBIS_NET_SO_SNDTIMEO/RCVTIMEO, read as microseconds in net.cpp), SharpProspero Socket.cs (SoSndTimeo/SoRcvTimeo, "in microseconds") and KytyPS5 network.cpp (0x1105 toSO_SNDTIMEO). Not measured on a console. PPSA34501 sets 0x1105 = 10000 on its UDP game sockets (seen in #2745, closed by the intake pause). #4371 changes the same function for libkernel's FreeBSD-numbered path; the two merge cleanly.Tested
Windows 11 (10.0.26300), WinLibs MinGW-w64 GCC 15.2.0 r7 (UCRT), Release,
-DBUILD_TESTING=ON, onmainat 2a5eca1:main'sExport.cpp, the newCheckMicrosecondTimeoutsinguest_sce_netaborts (exit0xc0000409);guest_sce_netpasses onmainitself, IPv6 checks included, so the abort is the new check. With the change it passes, 20 runs in a row.core/libs/prx/libc/CMakeLists.txtandcore/libs/prx/libkernel/CMakeLists.txtthat build on Windows pass, and so do the network tests (guest_datagram_recv,guest_datagram_recvfrom,guest_datagram_sceNetRecv,guest_datagram_sceNetRecvfrom,guest_udp,guest_resolver,guest_posix_filesystem).Linux (Ubuntu 24.04, GCC 13.3, Release), base 33ae282: the new
CheckMicrosecondTimeoutsinguest_sce_netaborts onmainatsceNetSetsockopt(..., 0x1106, ...) == 0(errno 45) and passes with the change, 20/20; the libSceNet, libc and libkernel tests are unchanged. Again on WSL2 (Ubuntu 24.04, GCC 13.3.0, Release with CI's configure flags), merged intomainat c952c2b, IPv6 checks included: it aborts withmain'sExport.cppand passes with the change, 20 runs in a row.tools/check_conventions.py --base origin/mainpasses.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)