1 suggestion
Optional improvements
[suggestion] · New comments omit MSG_DONTWAIT's platform limitation
The new P2P and HTTP comments leave implicit that MSG_DONTWAIT provides no protection where compat.h defines it as zero, making the distinction between per-call flags and socket mode unclear.
Location: src/net.cpp:1829 (head).
Details and suggested fix
Although the callers pass MSG_DONTWAIT as stated, compat.h defines it as 0 when the platform does not provide it, and Sock::Send/Recv forward the flags unchanged. On those platforms, non-blocking behavior therefore depends on the socket's mode, not the per-call flag. The preceding inheritance sentence partly explains this, but the belt-and-suspenders wording leaves that distinction implicit. Qualify both comments to explain that Linux relies on MSG_DONTWAIT before this change, while platforms without the flag rely on inherited non-blocking mode, and that the new call explicitly enforces the mode. This is a comment-only clarification; both new checks already enforce non-blocking mode.