10 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 22e0a1a536 sceNetInet: Wait for blocking socket calls in emulated time
Host sockets are always non-blocking, so a game's blocking recv(), accept()
and so on came back with EAGAIN at once, and connect() and poll() blocked the
whole emulator in the host call instead. Now recv, recvfrom, send, sendto,
accept, connect, poll and select try once, and if the call would block on a
blocking socket (no SO_NBIO or MSG_DONTWAIT), the thread waits and a
CoreTiming event retries it every millisecond. It ends when the call completes
or fails, or when SO_RCVTIMEO/SO_SNDTIMEO runs out in emulated time.

Sockets accepted on Linux are made non-blocking too: unlike BSD and Windows,
Linux doesn't pass that on from the listening socket. select() rejects a
tv_usec of a second or more with EINVAL.

Hardware behaviour from pspautotests net/inet/blocking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:03:59 +01:00
Henrik Rydgård e4de9dbfb5 Add some socket data in the debugger 2025-01-22 10:12:56 +01:00
Henrik Rydgård 0cec39d11f Add socket mapping for accept(). Don't know if games use it... 2025-01-08 19:36:01 +01:00
Henrik Rydgård 728268bb3f Better CreateSocket errro handling 2025-01-08 16:35:09 +01:00
Henrik Rydgård 698b73dd15 ImDebugger: Add Np and Sockets debugger windows, on a new Network menu 2025-01-08 16:29:18 +01:00
Henrik Rydgård c9c594462f Track non-blocking state 2025-01-08 16:25:44 +01:00
Henrik Rydgård b97b0e4cf6 Add Close method to socket manager 2025-01-08 16:25:15 +01:00
Henrik Rydgård a1744a6989 Add SocketManager::CreateSocket for convenience 2025-01-08 15:27:54 +01:00
Henrik Rydgård 155a9f9dbc Turn the socket manager into a class 2025-01-08 14:59:40 +01:00
Henrik Rydgård 2c3f7f6806 Add a central location for managing HLE sockets 2025-01-08 13:29:09 +01:00