TimeOut for NSMutableURLRequest

Discussion in 'iOS Programming' started by amalshah71, Oct 27, 2009.

  1. amalshah71 macrumors member

    Feb 1, 2009
    NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:40];
    In the code above a URL Request is formed with a 'timeoutInterval' of 40 seconds

    What i understand is 'timeoutInterval' would have it's effects in following cases:
    1) When server is down
    2) When server would take time > value set for 'timeoutInterval'
    3) When there is no means of commnunicating with outside world (i.e. no GPRS/wifi connection availability)

    Though only 1st point stands true

    Why won't the 'request time out' would occur when there is no GPRS/wifi?

    Or is it something else that i am missing?

  2. kainjow Moderator emeritus


    Jun 15, 2000
    I never found that timeout value to work that reliably. Instead I've used a standard timer to cancel the download manually, which worked perfectly.

Share This Page