Retry connect up to 100 times before giving up.