Closed isaackwan closed 8 years ago
Hi @isaackwan and welcome to Node.js
The ECONNRESET happens when the "connection was forcibly closed by a peer". The 'error' event is emitted in the connection instance and since there is no listener registered for it, Node.js throws an exception and crashes. This is intended and by design of Node.js.
If you want to ignore this error, you can add a listener to 'error' event on every new connection, like this:
conn.on('error', function (err) {
if (err.code !== 'ECONNRESET') {
// Ignore ECONNRESET and re throw anything else
throw err
}
})
For some guidance on how to debug this kind of situation, you may like to look at http://stackoverflow.com/questions/10814481/how-to-debug-a-socket-hang-up-error-in-nodejs/11542134#11542134
I'm closing this now, but feel free to reopen if it does not work for you ;) Best regards
Hello,
I am on OS X 10.11 and running node v5.3.0. I am running the basic demo app on README.
Whenever a connection is closed, an error of ECONNRESET is thrown and unhandled. I wonder if it is possible to fix the crash?
I am sorry that because I am rather new to node, I am not sure if I can debug this myself. Thanks in advance!