endless reconnects

According to http://nodejs.org/api/net.html#net_event_error the `close` event is fired after the `error` event. This causes endless connects and takes a lot of CPU. (I added a 5s timeout to force a connect if server isn't reachable)