Skip to content

[Windows] Call WSAStartup before WinSDK.socket(...) is called #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 5, 2025

Conversation

gregcotten
Copy link
Contributor

There are currently no issues using WSA functions because we're importing Foundation, but if we ever want to get rid of the Foundation import we'll run into trouble. This will ensure we're asking WSA for version 2.2 before any WinSDK.socket initializer gets called.

`import Foundation` is conveniently causing WSAStartup to get called implicitly, but if we ever try to get rid of the Foundation import we'll run into trouble.
Copy link

codecov bot commented Apr 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (6766cc0) to head (62d2d99).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
- Coverage   94.59%   94.56%   -0.03%     
==========================================
  Files          62       62              
  Lines        4032     4032              
==========================================
- Hits         3814     3813       -1     
- Misses        218      219       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swhitty
Copy link
Owner

swhitty commented Apr 5, 2025

Thanks, Foundation is quite pervasive in this package but I do think it’s mostly Data from FoundatialEssentials. I may be able to consolidate public interface on DataProtocol though.

One handler uses FoundationNetworking but that can be optionally imported.

@swhitty swhitty merged commit 1a6fad8 into swhitty:main Apr 5, 2025
20 of 22 checks passed
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