Closed angelnu closed 8 years ago
First thank you for your PR. For clarification before merging : are you positive no error event is triggered on ECONNREFUSED ? Do you get only a close event ? I think that should be signaled as an error at a lower level ... This leaves me wondering.
Yes, the error is reported (I use it to print a log and trigger a delayer reconnect) but a close event is triggered as well.
I even tried to register for errors with on("error",cb) instead of once("error", cb) with the hope of capturing the exception in the client close handler but this did not work. I am new to Javascrip so maybe there is another way for the code using the client to capture the exception but I did not find any...
Thanks for the quick response!
Ok cheched. Please use curly brackets in your if to match the global style. Can you also nullify ps only if it not already null ? Grouping ps handling this way would clarify the code for a newcomer.
Published to npm \o/ thanks for your PR :)
Fix uncaught exception on client.close() when socket did not connect
Client error: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"192.168.2.106","port":33009}