title: Connection reset by peer with iPhone NSURLConnection
body: <p>I'm trying to connect to a C# HTTP server with an iPhone app.  Pretty simple code so far:</p>
  
  <pre><code>    NSData *requestData = [ NSData dataWithBytes: [ requestMessage UTF8String ] length: [ requestMessage length ] ];
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:infoURL]];
      [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
      [request setHTTPMethod: @"POST"];
      [request setHTTPBody: requestData];
      NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  </code></pre>
  
  <p>The server gets the request, sends a response, and then terminates the connection.  The iPhone reports connection reset by peer. </p>
  
  <p>To be able to hit the server in Firefox on my desktop I need to go into it's advanced preffs and disabled keep-alive.  The reason, I assume, is because I'm terminating the connection right after I sent the response.  I do so because I don't want to reuse connections later.</p>
  
  <p>Anyway to disable keep-alive when using NSURLConnection on the iPhone, or any suggestions on modifying my .Net code?</p>