Home > DeveloperSection > Forums > How to send NSURLConnection requests simultaneously
Karen Green
Karen Green

Total Post:6

Posted on    November-18-2015 11:22 PM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 445  View(s)
Rate this:

I want to send url connection requests simultaneously to the same server using NSURLConnection class.

I'm trying to do it, but the second request do not start until the first one finishes.

How to solve this problem.

Tarun Kumar

Total Post:214

Posted on    November-20-2015 12:34 AM

If you want to sent request simultaneously to the same server using NSURLConnection, use this code:

+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request

returningResponse:(NSURLResponse **)response

error:(NSError **)error

when you will use this code, you need to start two threads to get the behavior you want.

(Your can also use Asynchronously version of NSURLConnection.)

Don't want to miss updates? Please click the below button!

Follow MindStick