Skip to content

Set TCP_NODELAY on the ps2link request socket#25

Open
doctorspider42 wants to merge 1 commit into
ps2dev:masterfrom
doctorspider42:tcp-nodelay-request-socket
Open

Set TCP_NODELAY on the ps2link request socket#25
doctorspider42 wants to merge 1 commit into
ps2dev:masterfrom
doctorspider42:tcp-nodelay-request-socket

Conversation

@doctorspider42

Copy link
Copy Markdown

Problem

ps2link fileio is a synchronous sequence of small request/response exchanges over the TCP request channel (port 0x4711). With Nagle enabled on the client side, each response collides with the PS2 stack delayed ACKs and stalls roughly one delayed-ACK period (~200 ms) per exchange.

Measured effect (PAL console, 100 Mbit ethernet, Windows host, ps2link v1.9.1): file serving capped at about 4 KB/s - a 424 KB texture took 106 seconds, and a homebrew game loading all of its assets over host: took 10 minutes to boot.

Fix

Set TCP_NODELAY on the SOCK_STREAM connect path in network_connect() (UDP sockets unaffected). Small responses then leave immediately instead of waiting for the ACK of the previous segment.

With the patch, the same texture serves in about a second and the same game boots in ~30 seconds; streaming 22 kHz PCM music over host: becomes usable. Verified on real hardware against ps2link v1.9.1; behaviour on Linux/macOS builds is the same code path (netinet/tcp.h include added for those platforms).

🤖 Generated with Claude Code

ps2link fileio is a synchronous sequence of small request/response
exchanges over the TCP request channel. With Nagle enabled on the client
side, each response collides with the PS2 delayed ACKs and stalls ~200 ms,
capping file serving at roughly 4 KB/s on a real console: a 424 KB texture
took 106 seconds to serve, and a homebrew game booting entirely over
host: took 10 minutes.

With TCP_NODELAY on the SOCK_STREAM connect path the same texture serves
in about a second and the same boot takes ~30 seconds (measured on a PAL
console over 100 Mbit ethernet, Windows host); streaming 22 kHz music
over host: becomes usable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant