mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +00:00
On Windows, when using libuv for socket polling, a non-blocking connect that returns the socket as "writable" doesn't necessarily mean the connection succeeded. The existing code tries to verify this by calling recv() to check the socket state. When recv() returns WSAENOTCONN, it means the connection attempt is still in progress. Previously, this was treated as an error, which caused fetch requests to 127.0.0.1 to hang or fail (while localhost worked because it went through DNS resolution with fallback addresses). The fix treats WSAENOTCONN the same as WSAEWOULDBLOCK - keep the socket polling for writable and wait for the connection to actually complete. Fixes #26789 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>