You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
554 B

'use strict';
require('../common');
var assert = require('assert');
var http = require('http');
var server = http.createServer(function(req, res) {
res.end();
});
var count = 0;
server.listen(0, function() {
var req = http.request({
port: this.address().port
}, function() {
assert(false, 'should not receive data');
});
req.on('abort', function() {
// should only be emitted once
count++;
server.close();
});
req.end();
req.abort();
req.abort();
});
process.on('exit', function() {
assert.equal(count, 1);
});