Commit Graph
5 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 58d051130c sceNetAdhoc: Wait for a relay PTP connect at a fixed point in emulated time
The connect PtpOpen starts goes through the relay on a host thread, so
when it finished in emulated time depended on the emulation speed and on
how busy the host was. At --speed=800 on a loaded CI runner it often
wasn't up within the 100 ms net/adhoc/pair/ptppoll polls for, while on a
PSP it's up a few ms after PtpOpen.

The relay's per-millisecond poll now waits (at most a second, once per
connect) for a connect in progress to finish, filling local listeners'
backlogs meanwhile, since the listener may be on the same console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:44:36 +01:00
Henrik RydgårdandClaude Opus 5.5 8f1406739e sceNetAdhoc: Relay fixes from comparing the transports' error handling
- GetPtpStat on a listener read its listen session as a connection,
  which could write past it; a listener now reports nothing waiting.
  Neither GetPtpStat nor GetPdpStat reports a dead session's negative
  status as a byte count any more, and a new PDP socket starts with
  nothing waiting instead of its buffer size.
- A poll of a connection whose peer has closed reports DISCONNECT, as
  the P2P transport and a PSP do (pspautotests net/adhoc/poll).
- Only a send that went out counts as the last send for a vanished
  peer's timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:44:36 +01:00
Henrik RydgårdandClaude Opus 5.5 f988ab9566 sceNetAdhoc: A relay listener accepts connections into its backlog by itself
A PSP completes a connect to a listener without the game calling Accept,
so an opened PTP connection is up a few ms after PtpOpen (pspautotests
net/adhoc/pair/ptppoll). The relay only answers the connecting side once
the listening side accepts, so the relay transport now accepts pending
connections into a queue as long as the listener's backlog, from a new
per-millisecond AdhocTransport::Poll() and from polls and accepts, and
PtpAccept takes them from there. A poll reports ACCEPT while the queue
isn't empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:44:36 +01:00
Henrik RydgårdandClaude Opus 5.5 752ecccf43 sceNetAdhoc: Don't treat a relay PTP listener's handle as a PDP session when polling
Polling an unconnected or listening PTP socket for SEND took the PDP
path in postoffice_can_send. For an opened connection that created a
PDP session and stored it as the socket's handle, so its sends and
receives failed afterwards (pspautotests net/adhoc/pair/ptppoll). A PTP
socket that isn't established now just isn't writable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:44:36 +01:00
Henrik RydgårdandClaude Opus 5.5 958d76ea77 sceNetAdhoc: Move the two transports into their own files
RelayTransport, with the aemu_postoffice helpers only it uses, goes to
AdhocTransportRelay.cpp, and P2PTransport to AdhocTransportP2P.cpp. The
helpers they share with sceNetAdhoc.cpp are declared in
AdhocTransport.h. Moved as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:09:35 +01:00