I'm having trouble handling a ECONNREFUSED error from my net.createConnection in node.js.
When I connect I get ECONREFUSED (which is fine), and I handle it this way:
testSocket.addListener('error', function(message) {
testSocket.destory();
});
That then gives me the error: TypeError: Object # has no method 'destory'.
My goal is to close the socket based on the error, which will then start a reconnect process.
Thanks in advance!
Did you mean destroy
? You spelt it incorrectly (distORy
)