Skip to content

fix: cross-platform socket handling for Windows#807

Closed
kajukitli wants to merge 2 commits into
littledivy:http2_libuvfrom
kajukitli:fix-windows-libuv-socket
Closed

fix: cross-platform socket handling for Windows#807
kajukitli wants to merge 2 commits into
littledivy:http2_libuvfrom
kajukitli:fix-windows-libuv-socket

Conversation

@kajukitli

Copy link
Copy Markdown
Collaborator

Fixes the Windows build failures by:

  1. Replacing Unix-only libc socket types (sockaddr_storage, sockaddr_in, sockaddr_in6, etc.) with cross-platform socket2::SockAddr
  2. Gating fcntl calls with #[cfg(unix)]
  3. Adding Windows-specific ioctlsocket for non-blocking mode
  4. Updating libnghttp2 dependency to use fixed enum constants (see fix: ensure consistent enum constant types across platforms denoland/libnghttp2#3)

This fixes the Windows CI failures in denoland#32418.

- Replace libc socket types with socket2::SockAddr for cross-platform compatibility
- Use #[cfg(unix)] for fcntl calls (non-blocking on Windows handled by libuv)
- Add Windows-specific ioctlsocket for non-blocking mode
- Update libnghttp2 dependency to use fixed enum constants
- Wrap libc::fcntl calls in #[cfg(unix)] block
- Use ioctlsocket on Windows for non-blocking mode
- Replace libc socket types with socket2::SockAddr for cross-platform compat
- Update libnghttp2 to fix bindgen enum type consistency (i32 vs u32)
@littledivy littledivy closed this Mar 4, 2026
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.

2 participants