Skip to content

Instantly share code, notes, and snippets.

Created March 14, 2013 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e59d2fc4b4b360fbeb61 to your computer and use it in GitHub Desktop.
Save anonymous/e59d2fc4b4b360fbeb61 to your computer and use it in GitHub Desktop.
var Socket = require('net').Socket;
var http = require('http');
var i = 0;
http.createServer(function(req, res) {
if (i < 150) {
var s = new Socket();
s.once('connect', function() {
console.log('connected!');
});
s.connect(3000, 'localhost');
i++;
}
res.end();
}).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment