HOW TO SEND NSURLCONNECTION REQUESTS SIMULTANEOUSLY

Karen Green

Total Post:6

Points:42
Posted by  Karen Green
 502  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. Tarun Kumar

    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!