Enable more networking specs on Windows #12176
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the event loop merged, a whole bunch of networking specs can be enabled now. Some are disabled or changed:
HTTP::Server
reuses the TCP port (SO_REUSEPORT)
: This constant is not defined on Windows. The closest thing is probablySO_REUSEADDR | SO_EXCLUSIVEADDRUSE
. This is not implemented here yet.HTTP::WebSocket
negotiates over HTTP correctly
: The specs try to connect a TCP socket to 0.0.0.0, andConnectEx
does not support this; these specs now use 127.0.0.1. But see also https://superuser.com/a/1307057.OAuth2::Client
get_access_token_using_*
: Those specs ultimately rely on non-blockingIO::FileDescriptor
s returned fromIO.pipe
. It seems file reads and writes on Windows are still blocking.The definition of
LibC::Linger
is copied from WinSock2.h.std/socket/unix_server_spec.cr
andstd/socket/unix_socket_spec.cr
are enabled because these files start with askip_file
now. Eventually we should do this to the rest of the failing spec files instead of having a separatewin32_std_spec.cr
, but that would be too much for this PR.