| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3b448a7 commit fafffd4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,14 +49,19 @@ var server = net.createServer(function(s) { | |||
| 49 | 49 | server.close(); | |
| 50 | 50 | })); | |
| 51 | 51 | ||
| 52 | - send(); | ||
| 53 | - send(function(err) { | ||
| 54 | - // Ignore errors when sending the second handle because the worker | ||
| 55 | - // may already have exited. | ||
| 56 | - if (err) { | ||
| 57 | - if (err.code !== 'ECONNREFUSED') { | ||
| 58 | - throw err; | ||
| 59 | - } | ||
| 60 | - } | ||
| 52 | + worker.on('online', function() { | ||
| 53 | + send(function(err) { | ||
| 54 | + assert.ifError(err); | ||
| 55 | + send(function(err) { | ||
| 56 | + // Ignore errors when sending the second handle because the worker | ||
| 57 | + // may already have exited. | ||
| 58 | + if (err) { | ||
| 59 | + if ((err.message !== 'channel closed') && | ||
| 60 | + (err.code !== 'ECONNREFUSED')) { | ||
| 61 | + throw err; | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + }); | ||
| 65 | + }); | ||
| 61 | 66 | }); | |
| 62 | 67 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments