Created
November 29, 2010 10:05
-
-
Save ddunlop/719784 to your computer and use it in GitHub Desktop.
node.js client.request generating EADDRINUSE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
util = require('util'); | |
var delta = 0, total = 0; | |
var server = http.createClient(8000, '127.0.0.1'); | |
(function get() { | |
var request = server.request('/404', {host:'127.0.0.1'}); | |
request.end(); | |
request.on('response', function(response) { | |
delta++; | |
total++; | |
process.nextTick(get); | |
}); | |
})(); | |
setInterval(function() { | |
util.log('requested: '+delta+' total: '+total); | |
delta = 0; | |
},1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 Nov 05:02:35 - requested: 1529 total: 1529 | |
29 Nov 05:02:36 - requested: 1482 total: 3011 | |
29 Nov 05:02:37 - requested: 1435 total: 4446 | |
29 Nov 05:02:38 - requested: 1474 total: 5920 | |
29 Nov 05:02:39 - requested: 1385 total: 7305 | |
29 Nov 05:02:40 - requested: 1241 total: 8546 | |
29 Nov 05:02:41 - requested: 1486 total: 10032 | |
29 Nov 05:02:42 - requested: 1485 total: 11517 | |
29 Nov 05:02:43 - requested: 1454 total: 12971 | |
29 Nov 05:02:44 - requested: 1464 total: 14435 | |
29 Nov 05:02:45 - requested: 1495 total: 15930 | |
node.js:59 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
Error: EADDRINUSE, Address already in use | |
at doConnect (net.js:446:19) | |
at net.js:602:9 | |
at Object.lookup (dns.js:133:5) | |
at Client.connect (net.js:596:20) | |
at Client._reconnect (http.js:1022:10) | |
at Client.<anonymous> (http.js:927:12) | |
at Client.emit (events.js:27:15) | |
at Array.<anonymous> (net.js:685:12) | |
at EventEmitter._tickCallback (node.js:51:22) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment