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 8362605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:58:48+00:00 2026-06-09T11:58:48+00:00

I am working on an iOS application which works as a thin client for

  • 0

I am working on an iOS application which works as a thin client for a bussiness server. There is a lot of requests sent to the server, a lot of data downloaded.

I don’t use any fancy request frameworks, just asynchronous NSURLConnection with a delegate.

The application usually works very well with both wifi and 3G BUT

some users report random disconnects when using 3G (in USA). All request are okey but once in a while a request fails with “Cannot Connect to Host” (-1004) error.

This affects user experience a lot.

Some facts:

  1. It doesn’t happen on wifi
  2. Users report that it doesn’t happen with other applications when using 3G.
  3. It’s not a timeout issue, the error appears 0.3-1.0 secs after starting the connection.
  4. We were not able to reproduce the problem using traceroute.
  5. Using SCNetworkReachability the host appears to be reachable (I know the limitations of this API).

Question What could be the cause of the problem? What connection properties can differ with 3G and wifi? How can I debug it?

Currently the only solution I see is to try to send the request again if the previous request has failed. However, I would like to find the cause of the problem first.

EDIT The problem was probably caused by one of our routers. IT guys are still inspecting the problem.

  • 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-09T11:58:49+00:00Added an answer on June 9, 2026 at 11:58 am

    All error codes can be found in the Apple documentation under the section

    CFNetwork Error Codes Reference

    The code -1004 is described only as

    kCFURLErrorCannotConnectToHost

    The connection failed because a
    connection cannot be made to the host. Available in OS X v10.6 and
    later. Declared in CFNetworkErrors.h.

    It basically means that the user has a connection (he is not on flightmode, data traffic is turned on, and his phone is registered in the network, you had a valid URL etc) but was actively prevented from connecting to the server. If the server was not responding, you would have had something more like a time out error after a longer waiting time, as you described.
    This kind of error is probably caused by something preventing the traffic to the server and can for example happen if the user is behind a firewall or a proxy.

    The issue could actually be caused by the provider, especially if you have no issues with some users, and random issues with others.

    As some other poster said, you could try to ask your users about their service provider, and more details about their location, or what they were doing when they got the error (like sitting in a vehicle or having bad reception in the countryside)

    If you can’t find any patterns, and if the error really just occur randomly and only for some users, and just sometimes, I would just consider it to be another unevitable issue that can be caused by the fact that mobile phones are never guaranteed to be connected all the time, and that some cellphone providers may not always deliver 100% of all packages that should be delivered out there… what you need to do then is just to handle the error.

    Build away the error by simply retrying, and not showing it to the user, at least not until after a sufficient amount of retries.

    One last thing to consider:

    If you send lots and lots of requests from your app, and lots of data, make sure that you are not "overconsuming" by spamming huge amounts of unfinished requests. This could cause the server or some proxy server on the way to refuse your request because it is too busy answering your other request. A refused request could cause an error like that. Make sure to send a reasonable amount of requests so that your user’s device has time to "breathe".

    Let your retry-scheme be a smart one where you start out by retrying a bunch of times within shorter time, and if it keeps failing, increase the time span to the next retry.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an application for iOS which will have the user fill out
I'm working in an iOS application which uses libXML2 to read XML retrieved from
I've an application which is working fine on iOS 4.0 or higher but keep
I'm working on an application for iOS in which I would like to place
I'm working on iOS application in which i want XML file to be the
I'm currently working on a cross-platform application (Win/OSX/iOS) which has a C++ (with Boost)
I am working on an iOS application that uses a SQLite database. In the
I'm working on an iOS application where most of the backend has already been
I am currently working on an update to an iOS application that was released
I am trying to implement ios mapView related application,Before 3 hour my application working

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.