mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
360cda1926
Fixes: https://github.com/nodejs/node/issues/27428 PR-URL: https://github.com/nodejs/node/pull/43112 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
16 lines
337 B
JavaScript
16 lines
337 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const net = require('net');
|
|
|
|
const server = net.createServer();
|
|
server.listen(0);
|
|
const port = server.address().port;
|
|
const conn = net.createConnection(port);
|
|
|
|
conn.on('error', common.mustCall(() => {
|
|
conn.resetAndDestroy();
|
|
}));
|
|
|
|
conn.on('close', common.mustCall());
|
|
server.close();
|