How should iOS design the timeout and retry mechanism for network requests

  ios, question

RT, this is a face-to-face test I saw online. I will only use AFN to set the request timeout. Retrying is to request it again after the request fails. I always feel so stupid and wonder if there is a better way to implement it.

Record a static variable, retry 3 times and stop retry 5 times.