fix(libSceNet): take 0x1105 and 0x1106 as the send and receive timeouts #4610
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4610"
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-12T16:45:18Z.
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, onmainat2a5eca11: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
33ae282e: the newCheckMicrosecondTimeoutsinguest_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 intomainatc952c2b0e, 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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:56:28Z.
Checked on current
main:guest_sce_netand the libSceNet/libs ctest scope pass; the newCheckMicrosecondTimeoutsfails withmain'sExport.cpp. 0x1105/0x1106 map to the same int-microsecond timeouts as 0x1005/0x1006 in set and get, matching shadPS4, SharpProspero and KytyPS5. Merging once the full Build is green.