How to send NSURLConnection requests simultaneously

Total Post:6

Points:42
 733  View(s)
Ratings:
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.

  1. Post:214

    Points:1642
    Re: How to send NSURLConnection requests simultaneously

    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.)

Answer