Skip to content

Export AcceptConn - #664

Merged
kazu-yamamoto merged 2 commits into
haskell:masterfrom
kazu-yamamoto:accept-conn
Nov 22, 2026
Merged

kazu-yamamoto merged 2 commits into
haskell:masterfrom
kazu-yamamoto:accept-conn

Conversation

@kazu-yamamoto

Copy link
Copy Markdown
Collaborator

Export the AcceptConn pattern (SO_ACCEPTCONN) from Network.Socket so that a server can check that a socket is listening before accepting on it.

  • macOS defines SO_ACCEPTCONN, but its getsockopt(2) fails with ENOPROTOOPT. So AcceptConn is unsupported there, and isSupportedSocketOption AcceptConn returns False.
  • Added a test: 0 before listen, 1 after. It passes on Linux and Windows (WinIO); it is skipped on macOS.

🤖 Generated with Claude Code

kazu-yamamoto and others added 2 commits November 22, 2026 19:53
It is unsupported on macOS, whose getsockopt(2) rejects SO_ACCEPTCONN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kazu-yamamoto
kazu-yamamoto merged commit c995641 into haskell:master Nov 22, 2026
@kazu-yamamoto
kazu-yamamoto deleted the accept-conn branch November 22, 2026 23:22
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