0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-net-connect-destroy.js
Robert Nagy a57da278f8 net: emit close on unconnected socket
Socket should always emit 'close'. Regardless
whether it has been connected or not.

PR-URL: https://github.com/nodejs/node/pull/29803
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-10-03 15:25:52 -07:00

8 lines
170 B
JavaScript

'use strict';
const common = require('../common');
const net = require('net');
const socket = new net.Socket();
socket.on('close', common.mustCall());
socket.destroy();