mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
On Windows a pair is a loopback stream or two connected datagram sockets rather than the console's local pair. After the peer closes, the first stream send reaches a socket the host still accepts and succeeds, where the console fails it with EPIPE, and an empty datagram receive waits on a socket the host never signals, where the console fails it with ECONNRESET; a datagram queued before the close is still delivered first. Both answers now come from the pair's lost peer before the host is waited on. Measured on a PS5 (13.60 and 11.60): send EPIPE (32) and receive ECONNRESET (54). The receive side asks the socket whether a datagram is queued rather than whether bytes are queued, because a datagram sent with no payload still has to be delivered: ioctlsocket answers 1 for one on this host, and select answers readable, while a byte count of the socket as a whole would answer 0 on a host that counts payload only. The Windows case now sends an empty datagram before the close and expects it, then 54.