title: ios multiple http connections
body: <p>The standard examples I'm seeing in iOS to do a simple GET HTTP connection is to:</p>
  
  <pre><code>NSString *finalURLstring = @"http://www.somesite.com?value=2";
  
  NSURL *url = [NSURL URLWithString:finalURLstring];
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
  NSURLConnection *urlConnection = [NSURLConnection connectionWithRequest:request delegate:self]; 
  </code></pre>
  
  <p>Then implement these functions:</p>
  
  <pre><code>-(void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  -(void) connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
  -(void) connectionDidFinishLoading:(NSURLConnection*)connection
  </code></pre>
  
  <p>And if you have multiple connections you just create multiple NSURLConnections and compare them in connectionDidFinishLoading:</p>
  
  <pre><code>if (connection == urlConnection1)
      // do something
  else if (connection == urlConnection2)
     // do something else
  </code></pre>
  
  <p>The issue with this is that you are created a new connection to the server each time right? Is it possible to create your NSURLConnection and reuse it? i.e. keep the connection open so you can make multiple calls instead of creating new connections on every call to the server?</p>
  
  <p>Thanks for your help,</p>
  
  <p>-David</p>