Skip to content

pspssh 0.4.1 — the socket was never non-blocking

Choose a tag to compare

@cobanov cobanov released this 31 Jul 00:58
· 39 commits to main since this release
334ab4c

SO_NONBLOCK is defined as 0 on the PSP. So the call that was supposed to make the socket non-blocking set option zero and changed nothing — and a blocking recv on a quiet socket never returns, which is a frozen screen you cannot tell from a crash. Readiness now comes from select(), as in the SDK's own samples.

The handshake loop now yields and has a deadline. A retry loop that never gives up the processor can starve the thread delivering the bytes it is waiting for. It also stops after 30 seconds rather than looking like work still in progress.

Wi-Fi failures now report the furthest state reached, not the last. A connection that got to state 2 and fell back to 0 was being described as "never started", which points at the wrong problem entirely. It now separates three cases:

  • never started — no saved connection at that number
  • scanned but never found it — wrong SSID, or not on 2.4 GHz
  • found it and was refused — nearly always the security type. A PSP does WEP and WPA-TKIP; WPA2-AES needs the wpa2psp plugin loaded.

Also tools/wire-probe.py, which listens on the host and dumps every byte a client sends with timestamps — the container's NAT hides the real client address, so the server log could not tell a PSP from a laptop.