ios - Using three NSURLConnections in a row causes third call to hang -
i running weird issue nsurlconnection. have controller makes 3 asynchronous requests in viewdidload method using following function:
+ (void)connectasyncwithurl:(nsurl *)url httpmethod:(nsstring *)httpmethod delegate:(id <nsurlconnectiondelegate>)delegate timeout:(nstimeinterval)timeout { nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl:url cachepolicy:nsurlrequestreloadignoringlocalcachedata timeoutinterval:timeout]; [request sethttpmethod:httpmethod]; [nsurlconnection connectionwithrequest:request delegate:delegate]; } the first 2 connections work expected. third hangs until timeout occurs. doing re-try after failure causes call succeed. doesn't seem matter order requests in - it's 1 called last fails. own server request being made to, , watching incoming network traffic shows me first 2 requests, third not appear third nsurlconnection until initial timeout. stranger after timeout occurs, if navigate away controller , again, issue no longer reproducible until restart app.
does have idea causing this?
some servers limit number of simultaneous connections single client two. if case, first 2 connections succeed , third hang until 1 of first 2 completes. sounds explain you're seeing.
Comments
Post a Comment