diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-11-18 22:18:07 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-11-19 03:47:38 +0300 |
commit | 3884b4185a72d63ee0344d16390eea852e8b1f89 (patch) | |
tree | 0b79b5869e8d0e1712980bce99d53336700b0281 /test | |
parent | 02039c9b53811cbce3b324c655f9bdfc7504813f (diff) |
Small clean ups
Diffstat (limited to 'test')
-rw-r--r-- | test/simple/test-pipe.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/simple/test-pipe.js b/test/simple/test-pipe.js index 75db48eabbb..3341e875ca3 100644 --- a/test/simple/test-pipe.js +++ b/test/simple/test-pipe.js @@ -17,20 +17,22 @@ var bufferSize = 5 * 1024 * 1024; */ var buffer = Buffer(bufferSize); for (var i = 0; i < buffer.length; i++) { - buffer[i] = parseInt(Math.random()*10000) % 256; + buffer[i] = 100; //parseInt(Math.random()*10000) % 256; } var web = http.Server(function (req, res) { web.close(); + console.log("web server connection fd=%d", req.connection.fd); + console.log(req.headers); var socket = net.Stream(); socket.connect(tcpPort); socket.on('connect', function () { - console.log('socket connected'); + console.log('http->tcp connected fd=%d', socket.fd); }); req.pipe(socket); @@ -54,7 +56,7 @@ web.listen(webPort, startClient); var tcp = net.Server(function (s) { tcp.close(); - console.log("tcp server connection"); + console.log("tcp server connection fd=%d", s.fd); var i = 0; @@ -91,6 +93,12 @@ function startClient () { req.write(buffer); req.end(); + + console.log("request fd=%d", req.connection.fd); + + // note the queue includes http headers. + assert.ok(req.connection.writeQueueSize() > buffer.length); + req.on('response', function (res) { console.log('Got response'); res.setEncoding('utf8'); |