0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/sequential/test-pipe-unref.js

20 lines
375 B
JavaScript
Raw Normal View History

'use strict';
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');
});