Files
bun.sh/packages
Claude Bot 752bf0488a fix(windows): handle WSAENOTCONN during non-blocking connect
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>
2026-02-07 09:04:17 +00:00
..