Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8496471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:51:51+00:00 2026-06-10T23:51:51+00:00

I have recently migrated from ASIHTTPRequest to AFNetworking, which has been great. However, the

  • 0

I have recently migrated from ASIHTTPRequest to AFNetworking, which has been great. However, the server that I am connecting with has some issues and sometimes causes my requests to timeout. When using ASIHTTPRequest it was possible to setup a retry count on a request in the event of a timeout using the following selector

-setNumberOfTimesToRetryOnTimeout:

This can be further referenced in this post, Can an ASIHTTPRequest be retried?

This is AFNetworking if you are unfamiliar
https://github.com/AFNetworking/AFNetworking#readme

I was unable to find an equivalent api in AFNetworking, has anyone found a solution for retrying network requests in the event of timeout using AFNetworking?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:51:53+00:00Added an answer on June 10, 2026 at 11:51 pm

    Matt Thompson developer of AFNetworking was kind enough to answer this for me. Below is the github link explaining the solution.

    https://github.com/AFNetworking/AFNetworking/issues/393

    Basically, AFNetworking doesn’t support this functionality. It is left to the developer to implement on a case by case basis as shown below (taken from Matt Thompson’s answer on github)

    - (void)downloadFileRetryingNumberOfTimes:(NSUInteger)ntimes 
                                  success:(void (^)(id responseObject))success 
                                  failure:(void (^)(NSError *error))failure
    {
        if (ntimes <= 0) {
            if (failure) {
                NSError *error = ...;
                failure(error);
            }
        } else {
            [self getPath:@"/path/to/file" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
                if (success) {
                    success(...);
                }
            } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                [self downloadFileRetryingNumberOfTimes:ntimes - 1 success:success failure:failure];
            }];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have recently migrated some 30 DTS packages in SQL Server 2000 to SSIS
I have recently started work on a project that has already been running for
Our team has recently migrated to git. We have production web application server with
We have a 3.5 Gb SVN repository recently migrated from a 6 Gb one.
I have recently had a linux server compromised from bots uploading .php scripts and
I have recently made changes in some code that makes a char name field
I recently migrated from a PostgreSQL database to a SQL Server database. To switch
I recently migrated a database from sql server 2005 to 2008 on windows server
I recently migrated an older application we have at work from Java 1.5 to
We are recently migrated from CVS to SVN and I have setup SVN WebDAV

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.