2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2010-12-04 15:20:34 -08:00
|
|
|
var common = require('../common');
|
|
|
|
var http = require('http');
|
2010-05-14 00:06:32 -07:00
|
|
|
|
2010-12-06 01:33:52 +03:00
|
|
|
var server = http.createServer(function(req, res) {
|
2010-05-14 00:06:32 -07:00
|
|
|
intentionally_not_defined();
|
2010-12-06 01:33:52 +03:00
|
|
|
res.writeHead(200, {'Content-Type': 'text/plain'});
|
|
|
|
res.write('Thank you, come again.');
|
2010-05-14 00:06:32 -07:00
|
|
|
res.end();
|
|
|
|
});
|
|
|
|
|
2010-12-06 01:33:52 +03:00
|
|
|
server.listen(common.PORT, function() {
|
|
|
|
for (var i = 0; i < 4; i += 1) {
|
2015-12-25 15:32:13 -08:00
|
|
|
http.get({ port: common.PORT, path: '/busy/' + i });
|
2010-06-19 23:13:28 -07:00
|
|
|
}
|
|
|
|
});
|
2010-05-14 00:06:32 -07:00
|
|
|
|
2010-12-04 16:11:57 -08:00
|
|
|
var exception_count = 0;
|
2010-07-15 14:09:33 -07:00
|
|
|
|
2011-10-15 01:08:36 +02:00
|
|
|
process.on('uncaughtException', function(err) {
|
2010-12-06 01:33:52 +03:00
|
|
|
console.log('Caught an exception: ' + err);
|
|
|
|
if (err.name === 'AssertionError') throw err;
|
2010-07-15 14:09:33 -07:00
|
|
|
if (++exception_count == 4) process.exit(0);
|
|
|
|
});
|
2010-05-14 00:06:32 -07:00
|
|
|
|