Send Macnetworkprog mailing list submissions to
email@hidden To subscribe or unsubscribe via the World Wide Web, visit
https://lists.apple.com/mailman/listinfo/macnetworkprog or, via email, send a message with subject or body 'help' to
email@hidden You can reach the person managing the list at
email@hidden When replying, please edit your Subject line so it is more specific
than "Re: Contents of Macnetworkprog digest..."
Today's Topics:
1. Testing resumeData from cancelByProducingResumeData:
(Scott Hancher)
2. Re: Testing resumeData from cancelByProducingResumeData:
(Quinn "The Eskimo!")
----------------------------------------------------------------------
Message: 1
Date: Wed, 19 Feb 2014 17:31:06 -0800
From: Scott Hancher <
email@hidden>
To:
email@hidden Subject: Testing resumeData from cancelByProducingResumeData:
Message-ID:
<
email@hidden" data-mce-href="mailto:
email@hidden">
email@hidden>
Content-Type: text/plain; charset="utf-8"
I'm currently working on some code that uses NSURLSessionDownloadTask's
cancelByProducingResumeData: to support cancelling/resuming of downloads,
and although I can get a non-nil NSData object from this method on
downloading from a network server, I can't seem to get a non-nil NSData
object when using a test server based on a BSD socket and responding to a
localhost URL. My test server works for numerous other test cases, but this
one's got me stumped. What is required of my test server for it to support
the creation of a non-nil NSData object from cancelByProducingResumeData?
Thank you,
Scott.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
https://lists.apple.com/mailman/private/macnetworkprog/attachments/20140219/2da6d07a/attachment.html>
------------------------------
Message: 2
Date: Wed, 19 Feb 2014 17:57:49 -0800
From: "Quinn \"The Eskimo!\"" <
email@hidden>
To: "
email@hidden Programming"
<
email@hidden>
Subject: Re: Testing resumeData from cancelByProducingResumeData:
Message-ID: <
email@hidden" data-mce-href="mailto:
email@hidden">
email@hidden>
Content-Type: text/plain; charset=us-ascii
On 19 Feb 2014, at 17:31, Scott Hancher <
email@hidden> wrote:
What is required of my test server for it to support the creation of a non-nil NSData object from cancelByProducingResumeData?
Last I checked to get resume data you must meet all the following criteria:
A. The scheme of the requested URL must be "http" or "https".
B. The request's method must be "GET".
C. The response must be an NSHTTPURLResponse (which should always be the case given point A).
D. The response must include either the "ETag" or "Last-Modified" headers (or both).
E. The file to which the task is downloading must be present. This file is managed internally by NSURLSession, so you shouldn't trip over this case (unless there's been a cache folder cleanup in the interim).
Share and Enjoy
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
------------------------------
_______________________________________________
Macnetworkprog mailing list
email@hidden https://lists.apple.com/mailman/listinfo/macnetworkprog End of Macnetworkprog Digest, Vol 11, Issue 21
**********************************************