add Errno::ECONNRESET to the catch. retry if the connection was lost.