Files
AnyPS5/docs/dev/debt/libSceNet.md
T
David 3d64981643 feat(libSceNet): implement sceNetResolverAbort and sceNetResolverStartNtoaMultipleRecords
UFC 6 (PPSA23566) imports sceNetResolverAbort (#992, #1502); Palworld
(PPSA23126) and LEGO Horizon Adventures (PPSA14632) import
sceNetResolverStartNtoaMultipleRecords.

Signatures and behaviour follow shadPS4 811bfcd7d17e
(src/core/libraries/net/net.cpp, net_resolver.cpp); the abort signature
also matches SharpProspero Interop/Net/Socket.cs.

sceNetResolverStartNtoaMultipleRecords shares the lookup of the Ex form
and, like it, throws for any flag. sceNetResolverAbort returns EBADF for
an unknown resolver and throws for flag bits other than NTOA (1) and
ATON (2) preservation. Host lookups cannot be interrupted, so an abort
during a running lookup makes it fail with EINTR when the host call
returns, without writing its output; with nothing running, the
preservation flags make the next lookup of that kind fail with EINTR.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit bcc8be8a58aa6a9e6b7c288d8a90af6ed63837aa)
2026-10-12 22:03:56 +02:00

4.2 KiB

libSceNet technical debt

Unknown function info

Functional

  • sceNetSetsockopt (libSceNet) sets SO_RCVTIMEO and SO_SNDTIMEO as the host socket's timeouts. On Windows a receive or send on a stream socket that times out fails with ETIMEDOUT, where FreeBSD returns EAGAIN or the partial count: Winsock leaves the connection in an indeterminate state after a timeout and reports no partial count (SOL_SOCKET options), so FreeBSD's behaviour needs the timeout waited for without the host option. A receive on a datagram socket that times out fails with EAGAIN
  • sceNetSendmsg and sceNetRecvmsg (libSceNet) copy the scatter/gather list through one host buffer and accept only the flags sceNetSend/sceNetRecv accept. Sending control data throws; a receive never returns control data (msg_controllen 0), since no socket option that queues it is supported
  • sceNetResolverAbort and sceNetResolverStartNtoaMultipleRecords (libSceNet) follow shadPS4 (net.cpp, net_resolver.cpp); the (int rid, int flags) signature of the abort also matches SharpProspero. Unverified on hardware. Lookups run synchronously over the host resolver, which cannot be interrupted: an abort while a lookup runs on another thread returns at once, and that lookup fails with EINTR without writing its output only when the host call returns; the abort flags are then ignored, as shadPS4 does for a running lookup. With nothing running, abort flag 1 (NTOA preservation) or 2 (ATON preservation) makes the next sceNetResolverStartNtoa* or sceNetResolverStartAton call on that resolver fail with EINTR, reported by sceNetResolverGetError, after its arguments are checked. Unlike shadPS4, which ignores them, other abort flag bits throw, and sceNetResolverStartNtoaMultipleRecords throws for any flag, including async (1) and 0x10000 (IP address literals disabled), as sceNetResolverStartNtoaMultipleRecordsEx does