Skip to content

Conversation

adierking
Copy link
Contributor

Provide an initial implementation of Windows socket sources using
WSAEventSelect(). This is sufficient for the dispatch_io_net test to
pass on Windows.

@adierking
Copy link
Contributor Author

cc @compnerd @ktopley-apple

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should libdispatch invoke WSAStartup somewhere perhaps? Although, I suppose that if the user is creating a socket, they will have initialised winsock and everything should be fine. libdispatch will never construct a socket on its own (unless it is in a test, where we can explicitly call WSAStartup.

@adierking
Copy link
Contributor Author

Should libdispatch invoke WSAStartup somewhere perhaps? Although, I suppose that if the user is creating a socket, they will have initialised winsock and everything should be fine. libdispatch will never construct a socket on its own (unless it is in a test, where we can explicitly call WSAStartup.

Right, since libdispatch only ever consumes sockets, I think it would be best to let clients initialize WinSock on their own. We don't have any means of knowing whether a program wants to use sockets otherwise, so this might lead to WinSock being unnecessarily initialized for programs that don't need to do any networking.

Provide an initial implementation of Windows socket sources using
WSAEventSelect(). This is sufficient for the dispatch_io_net test to
pass on Windows.
@compnerd
Copy link
Member

@swift-ci please test

@ktopley-apple ktopley-apple merged commit 9005cb4 into swiftlang:master Jul 29, 2019
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
event: support socket sources on Windows
Signed-off-by: Kim Topley <[email protected]>
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.

3 participants