-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Windows anonymous pipes do not work with createReadStream #57288
Comments
After reading the nodejs source code for hours, I finally figured out the source of the problem! Opening an anonymous pipe gives you a However, UV (the dependency that handles various cross platform stuff for Node, like i/o) expects a an actual file descriptor, to be passed in This of course doesn't work if you pass a The way to work around this would be to call This however doesn't seem to be possible to do with what we currently have: calling The solution would be for Node to directly allow inputting |
ping @nodejs/libuv |
IIRC this is what we did for libuv v2... |
It could be supported in v1.x by adding something like
|
This, with a way for either Node or UV to know which one to call depending of whatever was passed to be opened, would solve the issue. Any idea on the doability and ETA of this? Would I need to make a PR (please no) or are there node / libuv contributors who usually solve this kind of issue? Thx to all of you for your quick replies, by the way :) |
Doability seems guaranteed, it's a matter of someone rolling up their sleeves and sending the PR. Since you are the interested party here a good way to see it through is to take matters in your own hands. |
Version
Tested with 22.14.0 and 20.18.1
Platform
Subsystem
No response
What steps will reproduce the bug?
C# example for the anonymous pipe generator:
JS code that should be able to read and write from the pipes' file descriptors:
Source, should work according to the documentation and other examples I've seen.
How often does it reproduce? Is there a required condition?
Everytime I try to open an inherited anonymous pipe with NodeJS
What is the expected behavior? Why is that the expected behavior?
'data'
events should be emitted when read pipes have new data, and it should be possible to send data to write pipes too.What do you see instead?
Whenever I bind a callback to a ReadStream created from a pipe's FD:
Whenever I try to write to a WriteStream created from a pipe's FD:
Additional information
The same Anonymous pipe generator C# program given as an example works well with C++ using the Windows API, so it's not a C# problem:
Of course, it also works with C# clients.
The text was updated successfully, but these errors were encountered: