Handle refused connections and timeouts