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>
14 lines
408 B
JavaScript
14 lines
408 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 socket = net.connect(port, common.localhostIPv4, common.mustNotCall());
|
|
socket.on('error', common.mustNotCall());
|
|
server.close();
|
|
socket.resetAndDestroy();
|
|
// `reset` waiting socket connected to sent the RST packet
|
|
socket.destroy();
|