GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/test/sequential/test-regress-GH-877.js at master · rapzo/node Expand file tree/ Copy pathtest-regress-GH-877.jsMore file actions 52 lines (41 loc) · 1.2 KB / Copy pathtest-regress-GH-877.jsFile metadata and controls52 lines (41 loc) · 1.2 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 'use strict'; var common = require('../common'); var http = require('http'); var assert = require('assert'); var N = 20; var responses = 0; var maxQueued = 0; var agent = http.globalAgent; agent.maxSockets = 10; var server = http.createServer(function(req, res) { res.writeHead(200); res.end('Hello World\n'); }); var addrString = agent.getName({ host: '127.0.0.1', port: common.PORT }); server.listen(common.PORT, '127.0.0.1', function() { for (var i = 0; i < N; i++) { var options = { host: '127.0.0.1', port: common.PORT }; var req = http.get(options, function(res) { if (++responses === N) { server.close(); } res.resume(); }); assert.equal(req.agent, agent); console.log('Socket: ' + agent.sockets[addrString].length + '/' + agent.maxSockets + ' queued: ' + (agent.requests[addrString] ? agent.requests[addrString].length : 0)); var agentRequests = agent.requests[addrString] ? agent.requests[addrString].length : 0; if (maxQueued < agentRequests) { maxQueued = agentRequests; } } }); process.on('exit', function() { assert.strictEqual(responses, N); assert.ok(maxQueued <= 10); }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |