Skip to content

Give Winsock errors the IOErrorType of their errno - #637

Open
kazu-yamamoto wants to merge 3 commits into
haskell:masterfrom
kazu-yamamoto:port-632
Open

kazu-yamamoto wants to merge 3 commits into
haskell:masterfrom
kazu-yamamoto:port-632

Conversation

@kazu-yamamoto

Copy link
Copy Markdown
Collaborator

Ports #632 from v3.2 to master: on Windows, a Winsock error gets the IOErrorType of the errno of the same name, rather than OtherError.

The cherry-pick conflicted only in the test's imports. On master the Windows import GHC.IO.Exception (IOErrorType(..)) in Network/Socket/Internal.hs was then unused, so the second commit drops it.

Tested on Windows 11 with GHC 9.12.4.20260713 under WinIO and under MIO, and with GHC 9.8.2: 115 examples, 0 failures each, and no compiler warnings beyond those master already has. macOS: 119 examples, 0 failures.

🤖 Generated with Claude Code

kazu-yamamoto and others added 3 commits November 13, 2026 16:06
On Windows every socket error was OtherError.  Each Winsock code now
gets what errnoToIOError gives the errno of the same name, so a reset
is ResourceVanished as on POSIX.  WSAEINTR stays OtherError: it is what
closesocket gives a blocked call, not an interrupt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An RST which beat the client's connect failed the connect itself on
Linux, before recvWith was reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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