Skip to content
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

Support Unix domain sockets and emulate socketpair on Windows #10192

Merged
merged 3 commits into from
Jun 23, 2021

Commits on Jun 22, 2021

  1. Support Unix domain sockets on Windows

    Unix domain sockets were introduced in Insider Build 17063 (Windows 10
    1803) [1]. There are some caveats, as only SOCK_STREAM is supported
    and abstract sockets are not implemented (2). The header file
    <afunix.h> declares the `struct sockaddr_un` type, but hasn't been
    picked by mingw-w64. The struct definition is embedded if the header
    wasn't found. The curl [3] project has taken that approach too.
    
    It is expected that users get runtime errors if the system doesn't
    have support for Unix domain sockets.
    
    Fixes OCaml issues#8863.
    
    [1]: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
    (2): microsoft/WSL issues/4240#issuecomment-620805115
    [3]: https://github.com/curl/curl/blob/curl-7_74_0/lib/config-win32.h#L725-L734
    MisterDA committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    f40e899 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5663506 View commit details
    Browse the repository at this point in the history
  3. Emulate socketpair of Unix domain sockets of stream type on Windows

    Windows does not provide an implementation of socketpair.
    This emulates the behaviour of socketpair on Unix domain sockets of
    SOCK_STREAM type.
    
    Related to ocaml/ocaml pull#9104.
    MisterDA committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    fe2dab7 View commit details
    Browse the repository at this point in the history