martynsmith/node-irc — pull request #109 by mmattozzi (2012-10-05 03:39:18+00:00)
Title: Respond to ETIMEDOUT error with a retry

I've been using node-irc over a wireless network. Almost daily, my bot was getting disconnected with an error with the message:

Error: read ETIMEDOUT

When this happens, node-irc makes no attempt to retry the connection. I've been testing this modification for the past couple of weeks, and this has allowed my bot to reconnect cleanly when this error occurs.

It seems like this error gets fired before or in place of a close event. I'm not sure if this modification is the cleanest way to deal with this issue, but it seems like the smallest change to do so. There may be an entire class of errors that would benefit from a retry attempt, but I don't know of any others.