mirror of https://github.com/lukechilds/node.git
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.
23 lines
527 B
23 lines
527 B
13 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
var net = require('net');
|
||
|
|
||
|
// Server should only fire listen callback once
|
||
|
var server = net.createServer();
|
||
|
|
||
|
server.on('close', function() {
|
||
|
var listeners = server.listeners('listening');
|
||
|
console.log('Closed, listeners:', listeners.length);
|
||
|
assert.equal(0, listeners.length);
|
||
|
});
|
||
|
|
||
13 years ago
|
server.listen(common.PORT, function() {
|
||
13 years ago
|
server.close();
|
||
13 years ago
|
});
|
||
|
|
||
|
server.once('close', function() {
|
||
13 years ago
|
server.listen(common.PORT + 1, function() {
|
||
13 years ago
|
server.close();
|
||
|
});
|
||
|
});
|