On Sun, Oct 26, 2014 at 5:12 PM, Tim Kuijsten <[email protected]> wrote:
> The docs clearly state that the parent end of a pipe can be opened via the
> stdio array on the child_process instance. But the docs do not state
> anything about how to open the pipe in the child. Now with some
> experimenting I've found that both fs.createReadStream (while skipping the
> path parameter) and creating a new net.Socket work. It seems like the latter
> is the most appropriate way of doing this since no variables like path have
> to be omitted and a duplex stream can be opened right away. I would like to
> know if using net.Socket is the approved way of opening pipes in a child
> process and if so, I will create a PR to update the docs.
Yes, `new net.Socket({ fd: 42 })` is the best and most efficient way
to connect to a pipe or UNIX socket through an existing file
descriptor. `net.connect()` and `net.createConnection()` are
acceptable, too; they delegate to `net.Socket`.
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/CAHQurc-LHOSH5i238YvPnKieqYHruq5MHKm%3Dtqd2U65jEEKQaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.