• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLConnection and FTP Server-Side Timeout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection and FTP Server-Side Timeout


  • Subject: NSURLConnection and FTP Server-Side Timeout
  • From: Dirk Musfeldt <email@hidden>
  • Date: Wed, 7 Jan 2009 11:29:11 +0100

Hi,

I'm using +[NSURLConnection sendSynchronousRequest:returningResponse:error:] to request FTP downloads.
(In fact I'm using +[NSData dataWithContentsOfURL:options:error:] and + [NSString stringWithContentsOfURL:encoding:error:] which are mapped to the NSURLConnection method.)


Obviously NSURLConnection does not close the FTP connection and tries to reuse it. Unfortunately the FTP server requested has a time-out of 120s. After this idle time it sends a code of 421 (closing control connection) which is no response at this point because there was no request. To my understanding this is non-standard but common.

When I initiate another request to the same server after the time-out has happened NSURLConnection is not aware of the timeout but simply sends another CWD request. This will fail only after the NSURLConnection client-side time-out happened which is 60s by default. (Another issue is that this error is not even reported by the NSData and NSString methods.)

The FTP tool OTOH does cache the out-of-band reply code of 421 and closes the connection immediately after the next request. So there are possibilities to cope with this.

I consider this a bug (or at least a serious problem with the currently used approach) of NSURLConnection. Am I wrong with this?



Regards
Dirk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: NSURLConnection Latency on iPhone
  • Next by Date: cleanest way to get outside IP address
  • Previous by thread: Re: Safari is now sending If-None-Match: headers
  • Next by thread: cleanest way to get outside IP address
  • Index(es):
    • Date
    • Thread