You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
net: Create socket and immediately destroy throws AssertionError #2250
Starting in v2.3.2, this code which used to work, started to throw an AssertionError:
varnet=require('net')varsocket=net.connect(5000,'1.1.1.1')// nothing listening on this addresssocket.on('error',function(err){console.log('caught error'+err.message)})socket.destroy()
With the following exception:
assert.js:89
throw new assert.AssertionError({
^
AssertionError: false == true
at connect (net.js:778:10)
at net.js:930:7
at doNTCallback0 (node.js:408:9)
at process._tickCallback (node.js:337:13)
at Function.Module.runMain (module.js:473:11)
at startup (node.js:117:18)
at node.js:948:3
Activity
evanlucas commentedon Jul 27, 2015
Ah found it. PR coming shortly
feross commentedon Jul 27, 2015
Maybe consider adding a test as well, so there's no regression?
evanlucas commentedon Jul 27, 2015
Yep, added one. Thanks for the report
feross commentedon Jul 27, 2015
Heh, looks like there are two PRs out now :)
cjihrig commentedon Jul 27, 2015
Whoops
trevnorris commentedon Jul 27, 2015
My bad. Didn't take into account a user manually destroying the connection before the connection had completed.
net: don't throw on immediately destroyed socket
evanlucas commentedon Jul 27, 2015
Fixed in 503b089.