Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/parallel/test-net-connect-immediate-destroy.js

9 lines
241 B
JavaScript
Raw Normal View History

net: don't throw on immediately destroyed socket Fixes regression introduced in af249fa8a15bad8996187e73b480b30dcd881bad. 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>
2015-07-26 19:24:28 -05:00
'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();
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 1405ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API