Angel Java Lopez schreef op 26-10-14 om 21:16:
> |child.send(message, [sendHandle])|for details.
> 1. |'ipc'| - Create an IPC channel for passing messages/file
> descriptors between parent and child. A ChildProcess may have at
> most /one/ IPC stdio file descriptor. Setting this option enables
> the ChildProcess.send() method. If the child writes JSON messages to
> this file descriptor, then this will trigger
> ChildProcess.on('message'). If the child is a Node.js program, then
> the presence of an IPC channel will enable process.send() and
> process.on('message').
I'm already using the builtin IPC channel for messaging and passing
named sockets around. But because I use privilege separation within my
server I also like to have an efficient pipe, like the socketpair that
is used when specifying 'pipe' in stdio, to push some binary data to the
child (in the form of BSON).
-Tim
>
>
> On Sun, Oct 26, 2014 at 2:53 PM, Tim Kuijsten <
in...@netsend.nl
> <mailto:
in...@netsend.nl>> wrote:
>
> I would like to setup an IPC pipe with a submodule. Unfortunately it
> seems impossible to provide a stdio array with fork like the way
> this is done with spawn.
>
> Two questions:
>
> 1. is the following equivalent to `fork('lib/foo')`?
>
> spawn('node', ['lib/foo'], {
> stdio: ['pipe', 'pipe', 'pipe', 'ipc']
> });
>
> 2. should I use spawn when I want to share a pipe with a submodule? i.e.
>
> spawn('node', ['lib/foo'], {
> stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe']
> });
>
> -Tim
>
> --
> Job board:
http://jobs.nodejs.org/
> New group rules:
>
https://gist.github.com/__othiym23/9886289#file-__moderation-policy-md
>
https://github.com/joyent/__node/wiki/Mailing-List-__Posting-Guidelines
> send an email to nodejs+unsubscribe@__
googlegroups.com
> <mailto:
nodejs%2Bunsu...@googlegroups.com>.
> <mailto:
nod...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/__msgid/nodejs/544D3522.4040904%__40netsend.nl
> <
https://groups.google.com/d/msgid/nodejs/544D3522.4040904%40netsend.nl>.
> For more options, visit
https://groups.google.com/d/__optout
> <
https://groups.google.com/d/optout>.
> an email to
nodejs+un...@googlegroups.com
> <mailto:
nodejs+un...@googlegroups.com>.
> <mailto:
nod...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/nodejs/CAMs%2BDqKcJoxMQjz78Z%2BP5sn%2BvJqUmWffFykOw0wWQa%2BnjJB%3Dgw%40mail.gmail.com
> <
https://groups.google.com/d/msgid/nodejs/CAMs%2BDqKcJoxMQjz78Z%2BP5sn%2BvJqUmWffFykOw0wWQa%2BnjJB%3Dgw%40mail.gmail.com?utm_medium=email&utm_source=footer>.