diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-10-07 16:43:53 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-10-07 16:43:55 -0700 |
commit | 12486a6437c7615af52f3d239f0b5a3000aee45d (patch) | |
tree | e0a9829e084706cbb01597625a5cd50810d31905 /test/fixtures | |
parent | a23d8ad3132ceb1a73fb02bcaf119a11a9d33e85 (diff) | |
download | node-new-12486a6437c7615af52f3d239f0b5a3000aee45d.tar.gz |
Change API for sending handles
Does not support sending net.Server objects only raw TCPWrap objects.
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/fork2.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/test/fixtures/fork2.js b/test/fixtures/fork2.js index 8aa579c31b..d8a39f0b64 100644 --- a/test/fixtures/fork2.js +++ b/test/fixtures/fork2.js @@ -3,25 +3,24 @@ var net = require('net'); var connections = 0; -process.on('message', function(m, server) { +process.on('message', function(m, serverHandle) { console.log('CHILD got message:', m); assert.ok(m.hello); - assert.ok(server); - assert.ok(server instanceof net.Server); + assert.ok(serverHandle); - // TODO need better API for this. - server._backlog = 9; - - server.listen(function() { - process.send({ gotHandle: true }); - }); - - server.on('connection', function(c) { + var server = new net.Server(function(c) { connections++; console.log('CHILD got connection'); c.destroy(); process.send({ childConnections: connections }); }); + + // TODO need better API for this. + server._backlog = 9; + + server.listen(serverHandle, function() { + process.send({ gotHandle: true }); + }); }); |