Created
February 21, 2014 14:46
-
-
Save Gocrazy/9135492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var child_process = require('child_process'); | |
| var net = require('net'); | |
| var tcpSrv = net.createServer(); | |
| tcpSrv.listen(3000, function() { | |
| for (var i = 1; i <= 4; i++) { | |
| var worker = child_process.fork('worker.js'); | |
| worker.send(i, tcpSrv._handle); | |
| } | |
| tcpSrv.close(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment