site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1550872574; bh=FPpNPFYmCL7SFRrW0VGks9CqIzjlyl9h4LTVmIunSnY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=RI13GMkNGQmHjLB1NW/rMXf7kRsL5oZMkUoBIDVuI7WUZYzbcT+GhVl3QhnekHRTizLOwHe93hruHxOPiCxZaIK4d8jyL/PGHV+jjVJdwnJR2sBQQ5yWUeLg3IMhhqWpi02OYRu8JV0kgcmneKPs04K+ZloSZRo4G957j5jo8qKaU4gXII5gS6EgA7SzsG8X7xo8rUd4QtdzSw0qj1ocVMiH4XuLWj1uBsYvuMwIClBNjpwE06SIUIQhPNVJqvcLgvqeCuFDzOW7gbgkMhD8at8RDqoBuq7khHNSehPBwqZEAswvddVPOILqEanQcpXwVaCe87lFQnVW5icgMDjj+g== That's more-or-less what we ended up doing, but implemented it as a custom NSURLProtocol that can be used by a session's configuration (so it can be used with any session, or subclassed to handle specific endpoints, etc.). When using it one thing to keep in mind was to ensure the timeout for the session (or the tasks themselves) was long enough so they didn't get cancelled before the protocol got to handling them.
On Oct 10, 2018, at 1:37 PM, Jens Alfke <jens@mooseyard.com> wrote:
You can queue the requests yourself in an NSMutableArray or something. Then issue the first one. When the task's delegate’s didSendBodyData: method is called, schedule starting the next request (either immediately or after a delay of ≤ 1/32 sec.)
This is a bit conservative because that delegate method won’t be called until some time after the HTTP request is sent, but it should keep you from getting errors.
—Jens
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com
participants (1)
-
Sebastien Boisvert