Skip to content

Give Winsock errors the IOErrorType of their errno - #637

Merged
kazu-yamamoto merged 3 commits into
haskell:masterfrom
kazu-yamamoto:port-632
Nov 14, 2026
Merged

kazu-yamamoto merged 3 commits into
haskell:masterfrom
kazu-yamamoto:port-632

Conversation

@kazu-yamamoto

@kazu-yamamoto kazu-yamamoto commented Nov 13, 2026 •

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 with No IO Manager, 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>
@kazu-yamamoto
kazu-yamamoto merged commit 68c1dbd into haskell:master Nov 14, 2026
11 checks passed
kazu-yamamoto added a commit that referenced this pull request Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kazu-yamamoto
kazu-yamamoto deleted the port-632 branch November 14, 2026 21:44
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