From 6ed8d41ddd657116199ea186a7860057b539d097 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 12 Oct 2011 17:44:12 +0200 Subject: [PATCH] docs: fix child_process.send() example --- doc/api/child_processes.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/child_processes.markdown b/doc/api/child_processes.markdown index b081f93eb5b..23279c09272 100644 --- a/doc/api/child_processes.markdown +++ b/doc/api/child_processes.markdown @@ -234,7 +234,9 @@ another process. Child will receive the handle as as second argument to the var server = require('net').createServer(); var child = require('child_process').fork(__dirname + '/child.js'); // Open up the server object and send the handle. - child.send({ server: true }, server._handle); + server.listen(1337, function() { + child.send({ server: true }, server._handle); + }); Here is an example of receiving the server handle and sharing it between processes: