| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 33b7c50 commit a7b3274
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,21 +40,20 @@ if (cluster.isMaster) { | |||
| 40 | 40 | })); | |
| 41 | 41 | } | |
| 42 | 42 | } else { | |
| 43 | - const server = net.createServer(function(socket) { | ||
| 43 | + const server = net.createServer(common.mustCall((socket) => { | ||
| 44 | 44 | process.send('send-handle-1', socket); | |
| 45 | 45 | process.send('send-handle-2', socket); | |
| 46 | - }); | ||
| 46 | + })); | ||
| 47 | 47 | ||
| 48 | 48 | server.listen(0, function() { | |
| 49 | 49 | const client = net.connect({ | |
| 50 | 50 | host: 'localhost', | |
| 51 | 51 | port: server.address().port | |
| 52 | 52 | }); | |
| 53 | 53 | client.on('close', common.mustCall(() => { cluster.worker.disconnect(); })); | |
| 54 | - setTimeout(function() { client.end(); }, 50); | ||
| 54 | + client.on('connect', () => { client.end(); }); | ||
| 55 | 55 | }).on('error', function(e) { | |
| 56 | 56 | console.error(e); | |
| 57 | 57 | assert.fail('server.listen failed'); | |
| 58 | - cluster.worker.disconnect(); | ||
| 59 | 58 | }); | |
| 60 | 59 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments