-
Notifications
You must be signed in to change notification settings - Fork 176
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.socketpair
using PF_UNIX
on Windows and OCaml 4.14
#870
Conversation
Hi, Thanks for the contribution. IIUC, this won't be effective until OCaml4.14 is released (or until someone installs it within a custom opam switch or something along those lines). I'm tempted to withhold merging until 4.14 is released or is about to be released. It might be a bit long though. In the meantime, I'll try to get someone with more C and system-programming chops to do the review. |
I'm tempted to withhold merging until 4.14 is released or is about to be
released. It might be a bit long though.
Completely understandable, but please consider cherry-picking the first two
commits. The first one is a bug-fix, and the second enables socketpair over
IPv6 (because why not).
Let's say I'll bump this PR when OCaml 4.14 alpha is released.
In the meantime, I'll try to get someone with more C and
system-programming chops to do the review.
Thank you!
… |
Ok, I'll cherry-pick those after the review. Thanks! |
Looks good to me, too. |
Ok, I'll open a branch for cherry-picking the prefix of the PR. Thanks for the reviews! |
Done in #876 I simply cherry-picked the commits and added a changelog entry. I'll merge once the CI passes. |
4409f7c
to
fbd2900
Compare
Unix.socketpair
using PF_UNIX
on Windows and OCaml 4.14
Support for Unix domain sockets on Windows and a socketpair emulation using PF_UNIX was added in OCaml 4.14 in PR 10192.
fbd2900
to
dad167f
Compare
A few improvements (imho) to the support of
socketpair
under Windows:socket_domain_table
length;socketpair
emulation (I'm rooting for the Universal Deployment of IPv6);socketpair
emulation using Unix domain sockets to be introduced in OCaml 4.14 (PR 10192).This allows us to use socketpair and Unix domain sockets to perform IO redirection with processes, which isn't possible with current sockets in OCaml under Windows. Sockets have to be created in non-overlapped mode, with
WSASocket(domain, type, protocol, NULL, 0, 0)
rather thansocket(domain, type, protocol)
(overlapped). Unix domain sockets under Windows don't have this limitation.