> On Jun 28, 2016, at 12:52 PM, Jim Adams <jim.ad...@sas.com> wrote:
> 
> I have an application that has the requirement that the accesses to the 
> server be single threaded, i.e. the second request cannot go through until 
> the first request has completed.

That’s pretty unusual. I take it this is a restriction of the server, i.e. that 
it can only handle one HTTP request at a time from a client?

> I am using NSURLSession and NSURLSessionDataTask. I have set the Maximum 
> Concurrent Host number in the configuration to 1 but I have seen evidence 
> that there are simultaneous requests going up to my servers.

You mean HTTPMaximumConnectionsPerHost? If you set that you’ve limited the 
number of sockets to one, and HTTP 1.x doesn’t multiplex requests on a socket, 
so you won’t be sending any simultaneous requests.

You might need to turn pipelining off (I think it’s off by default, but better 
safe than sorry.)

> My evidence comes from looking in the server logs. I have 3 servers in AWS 
> behind an ELB. If I am able to get the cookies back from the server before 
> sending the next request then my request will go to the same server that the 
> last request went to. If I don’t wait then then the request goes to a random 
> server. If I watch the logs I can see the requests come in on multiple 
> servers.

That’s odd. I suggest using a tool like HTTPScoop to watch how the requests are 
being sent on the client.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to