Created
February 11, 2020 19:43
-
-
Save TooTallNate/7b540264334d967bbc233621692373ff to your computer and use it in GitHub Desktop.
Does anyone know why this script takes >2s to receive the `error` event on Windows? On MacOS it's essentially instant…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time node slow-windows-error.js | |
Error: connect ECONNREFUSED 127.0.0.1:4 | |
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:16) { | |
errno: 'ECONNREFUSED', | |
code: 'ECONNREFUSED', | |
syscall: 'connect', | |
address: '127.0.0.1', | |
port: 4 | |
} | |
real 0m0.093s | |
user 0m0.045s | |
sys 0m0.024s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time node slow-windows-error.js | |
Error: connect ECONNREFUSED 127.0.0.1:4 | |
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) { | |
errno: 'ECONNREFUSED', | |
code: 'ECONNREFUSED', | |
syscall: 'connect', | |
address: '127.0.0.1', | |
port: 4 | |
} | |
real 0m2.345s | |
user 0m0.000s | |
sys 0m0.046s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net'); | |
net.connect({ host: '127.0.0.1', port: 4 }).on('error', console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment