summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-10-07 16:43:53 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-10-07 16:43:55 -0700
commit12486a6437c7615af52f3d239f0b5a3000aee45d (patch)
treee0a9829e084706cbb01597625a5cd50810d31905 /test/fixtures
parenta23d8ad3132ceb1a73fb02bcaf119a11a9d33e85 (diff)
downloadnode-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.js21
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 });
+ });
});