handle errors, like ECONNRESET, on the socket