| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 90723af commit d2b5dcb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -551,7 +551,7 @@ function setupChannel(target, channel) { | |||
| 551 | 551 | handle: handle, | |
| 552 | 552 | message: message.msg, | |
| 553 | 553 | }); | |
| 554 | - return; | ||
| 554 | + return this._handleQueue.length === 1; | ||
| 555 | 555 | } | |
| 556 | 556 | ||
| 557 | 557 | var obj = handleConversion[message.type]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,29 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | + const path = require('path'); | ||
| 5 | + const net = require('net'); | ||
| 4 | 6 | const fork = require('child_process').fork; | |
| 7 | + const spawn = require('child_process').spawn; | ||
| 5 | 8 | ||
| 6 | - const n = fork(common.fixturesDir + '/empty.js'); | ||
| 9 | + const emptyFile = path.join(common.fixturesDir, 'empty.js'); | ||
| 10 | + | ||
| 11 | + const n = fork(emptyFile); | ||
| 7 | 12 | ||
| 8 | 13 | const rv = n.send({ hello: 'world' }); | |
| 9 | 14 | assert.strictEqual(rv, true); | |
| 15 | + | ||
| 16 | + const spawnOptions = { stdio: ['pipe', 'pipe', 'pipe', 'ipc'] }; | ||
| 17 | + const s = spawn(process.execPath, [emptyFile], spawnOptions); | ||
| 18 | + var handle = null; | ||
| 19 | + s.on('exit', function() { | ||
| 20 | + handle.close(); | ||
| 21 | + }); | ||
| 22 | + | ||
| 23 | + net.createServer(common.fail).listen(common.PORT, function() { | ||
| 24 | + handle = this._handle; | ||
| 25 | + assert.strictEqual(s.send('one', handle), true); | ||
| 26 | + assert.strictEqual(s.send('two', handle), true); | ||
| 27 | + assert.strictEqual(s.send('three'), false); | ||
| 28 | + assert.strictEqual(s.send('four'), false); | ||
| 29 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments