mMaxContiguousConnectionFailures can be set to -1 for infinite.