Skip to content

HACK: make FileHandle build on Windows again #1955

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

Conversation

compnerd
Copy link
Member

The readability and writability handlers are not yet implemented on
windows, and cannot be assigned to. A SOCKET is not a file descriptor
on Windows which means that the shared implementation does not work for
Windows.

@compnerd
Copy link
Member Author

CC: @millenomi

@@ -888,6 +893,10 @@ extension FileHandle {
}

open func acceptConnectionInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?) {
#if os(Windows)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is for treating fds like sockets, it's fine if this is unavailable on Windows only.

@compnerd compnerd force-pushed the incase-of-emergency-glue-the-window branch from 9ead37b to f0b6b10 Compare March 9, 2019 17:22
@compnerd
Copy link
Member Author

compnerd commented Mar 9, 2019

@swift-ci please test

A SOCKET is not a file descriptor on Windows which means that the shared
implementation does not work for Windows.  This allows us to build
again.  It should be possible to provide a special constructor that
takes a SOCKET rather than a fd and wait on that though, so for now, use
NSUnimplemented to guard that path.
@compnerd compnerd force-pushed the incase-of-emergency-glue-the-window branch from f0b6b10 to fc0f8d6 Compare March 11, 2019 00:24
@compnerd
Copy link
Member Author

@swift-ci please test

@millenomi millenomi merged commit a132f6e into swiftlang:master Mar 12, 2019
@compnerd compnerd deleted the incase-of-emergency-glue-the-window branch March 12, 2019 05:23
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