A mistake here would be critical, as it would allow a malicious peer to stall us indefinitely for free. This is not currently an issue because:
- while on Linux accepted sockets do not inherit O_NONBLOCK, we always send() and recv() on Linux/macOS/BSD with MSG_DONTWAIT;
- while on Windows MSG_DONTWAIT is unset, accepted sockets do inherit the non-blocking option [^1].
Therefore, set accepted sockets (inbound P2P connections and HTTP clients) as non-blocking explicitly, like CreateSockOS() does for the sockets it creates. A belt-and-suspenders check costs virtually nothing here, and we already have similar ones for less important options (such as TCP_NODELAY, which as far as i know is inherited by accepted sockets on all our supported platforms).
[^1]: Source is this implicit remark in the accept() doc, plus my own testing.