| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3488fa8 commit 90219c3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,8 +17,8 @@ if (cluster.isMaster) { | |||
| 17 | 17 | worker2 = cluster.fork(); | |
| 18 | 18 | worker2.on('online', function() { | |
| 19 | 19 | conn = net.connect(common.PORT, common.mustCall(function() { | |
| 20 | - worker1.send('die'); | ||
| 21 | - worker2.send('die'); | ||
| 20 | + worker1.disconnect(); | ||
| 21 | + worker2.disconnect(); | ||
| 22 | 22 | })); | |
| 23 | 23 | conn.on('error', function(e) { | |
| 24 | 24 | // ECONNRESET is OK | |
@@ -39,17 +39,10 @@ if (cluster.isMaster) { | |||
| 39 | 39 | return; | |
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | - var server = net.createServer(function(c) { | ||
| 42 | + const server = net.createServer(function(c) { | ||
| 43 | 43 | c.end('bye'); | |
| 44 | 44 | }); | |
| 45 | 45 | ||
| 46 | 46 | server.listen(common.PORT, function() { | |
| 47 | 47 | process.send('listening'); | |
| 48 | 48 | }); | |
| 49 | - | ||
| 50 | - process.on('message', function(msg) { | ||
| 51 | - if (msg !== 'die') return; | ||
| 52 | - server.close(function() { | ||
| 53 | - setImmediate(() => process.disconnect()); | ||
| 54 | - }); | ||
| 55 | - }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments