mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 15:35:41 +00:00

PR-URL: https://github.com/nodejs/node/pull/17948 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
23 lines
519 B
JavaScript
23 lines
519 B
JavaScript
'use strict';
|
|
// Just test that destroying stdin doesn't mess up listening on a server.
|
|
// This is a regression test for
|
|
// https://github.com/nodejs/node-v0.x-archive/issues/746.
|
|
|
|
const common = require('../common');
|
|
const net = require('net');
|
|
|
|
process.stdin.destroy();
|
|
|
|
const server = net.createServer(common.mustCall(function(socket) {
|
|
console.log('accepted');
|
|
socket.end();
|
|
server.close();
|
|
}));
|
|
|
|
|
|
server.listen(0, function() {
|
|
console.log('listening...');
|
|
|
|
net.createConnection(this.address().port);
|
|
});
|