node/test/sequential/test-pipe-unref.js

19 lines
361 B
JavaScript
Raw Normal View History

var common = require('../common');
var assert = require('assert');
var net = require('net');
var closed = false;
var s = net.Server();
s.listen(common.PIPE);
s.unref();
setTimeout(function() {
closed = true;
s.close();
}, 1000).unref();
process.on('exit', function() {
assert.strictEqual(closed, false, 'Unrefd socket should not hold loop open');
});