Skip to content
Browse files

docs: fix child_process.send() example

  • Loading branch information...
1 parent bc96302 commit 6ed8d41ddd657116199ea186a7860057b539d097 @bnoordhuis bnoordhuis committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 doc/api/child_processes.markdown
View
4 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:

0 comments on commit 6ed8d41

Please sign in to comment.
Something went wrong with that request. Please try again.