mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 18:29:01 +00:00

Fixes regression introduced in af249fa8a1
.
With connect being deferred to the next tick, Socket.destroy could be
called before connect. Socket.destroy sets _connecting to false which
would cause an assertion error.
Fixes: https://github.com/nodejs/io.js/issues/2250
PR-URL: https://github.com/nodejs/io.js/pull/2251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
9 lines
241 B
JavaScript
9 lines
241 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const socket = net.connect(common.PORT, common.localhostIPv4, assert.fail);
|
|
socket.on('error', assert.fail);
|
|
socket.destroy();
|