title: AFNetworking + NSOperation issues with concurrent requests
body: <p>i got some problems when using AFNetworking in my project.
  let's see:</p>
  
  <pre><code>NSOperationQueue* queue = [[NSOperationQueue alloc] init];
  
  AFJSONRequestOperation* op1 = [self operationSyncLeagues]; //URL=http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?lastsynced=1340362261&amp;task=league.listall_syncable&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85
  
  AFJSONRequestOperation* op2 =[self operationSyncMatches]; // URL = http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?pagesize=10&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85&amp;page=1&amp;league_id=51&amp;lastsynced=1340362314&amp;task=match.schedule_syncable
  
  [queue setMaxConcurrentOperationCount:4];
  [queue addOperations:[NSArray arrayWithObjects: op1, op2, nil] waitUntilFinished:NO];
  </code></pre>
  
  <p>and now, let's take a look with my Logs (i put some NSLog in AFURLConnectionOperation.m for debugging):</p>
  
  <blockquote>
    <p>2 operations start at the same time. fine!</p>
  </blockquote>
  
  <p>2012-06-26 00:28:21.688 zozo[11726:18d03] <em>*</em>[START] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?lastsynced=1340362261&amp;task=league.listall_syncable&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85</p>
  
  <p>2012-06-26 00:28:21.689 zozo[11726:18d03] <em>*</em>[START] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?pagesize=10&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85&amp;page=1&amp;league_id=51&amp;lastsynced=1340362314&amp;task=match.schedule_syncable</p>
  
  <blockquote>
    <p>no redirection but why it fire willSendRequest? could check my API's url for detail</p>
  </blockquote>
  
  <p>2012-06-26 00:28:21.689 zozo[11726:18d03] willSendRequest [redirectResponse description]:(null)
  2012-06-26 00:28:21.690 zozo[11726:18d03] willSendRequest [redirectResponse description]:(null)</p>
  
  <p>2012-06-26 00:28:21.913 zozo[11726:18d03] <em>*</em>[90 bytes] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?lastsynced=1340362261&amp;task=league.listall_syncable&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85</p>
  
  <p>2012-06-26 00:28:21.913 zozo[11726:18d03] <em>*</em>[FINISHED] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?lastsynced=1340362261&amp;task=league.listall_syncable&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85</p>
  
  <p>2012-06-26 <strong>00:28:21</strong>.914 zozo[11726:15203] sync Leagues sucessful</p>
  
  <blockquote>
    <p>Operation 1 finished but Operation 2 start getting data after 5 seconds. WHY?</p>
  </blockquote>
  
  <p>2012-06-26 <strong>00:28:26</strong>.421 zozo[11726:18d03] <em>*</em>[92 bytes] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?pagesize=10&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85&amp;page=1&amp;league_id=51&amp;lastsynced=1340362314&amp;task=match.schedule_syncable</p>
  
  <p>2012-06-26 00:28:26.422 zozo[11726:18d03] <em>*</em>[FINISHED] URL: http://pm[dot]mvdigital[dot]vn/sandbox/zozo/smartphone.php?pagesize=10&amp;session_id=1946a6504e90f80cb3bd21fb90b0be85&amp;page=1&amp;league_id=51&amp;lastsynced=1340362314&amp;task=match.schedule_syncable</p>
  
  <p>2012-06-26 00:28:26.423 zozo[11726:15203] sync Matches sucessful</p>
  
  <blockquote>
    <p>From AFNetworking doc: "Another option would be to take advantage of the fact that AFJSONRequestOperation, like all of the request operations in AFNetworking, is a subclass of NSOperation. In combination with NSOperationQueue, you can easily have several requests running concurrently (you have the ability to setting a maximum number of operations to run concurrently to keep your network from getting bogged down)."</p>
  </blockquote>
  
  <p>&lt;== so what's the problem here? i just got 2 requests (92 bytes each) and i can't make them running like <strong>concurrently</strong>. any bugs here?</p>
  
  <p>p/s: 
  I've been tried with AFHTTPClient using sharedclient but i haven't no lucky. 
  my server's fine and i haven't any issue with my Android client
  Anybody got same problem? Are there any limitation with concurrent requets count?</p>
  
  <p>http://pm[dot]mvdigital[dot]vn/ &lt;== <a href="http://pm.mvdigital.vn/" rel="nofollow">http://pm.mvdigital.vn/</a></p>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <blockquote>
    <p>I found answer by myself, click here: <a href="http://github.com/AFNetworking/AFNetworking/issues/387" rel="nofollow">http://github.com/AFNetworking/AFNetworking/issues/387</a></p>
  </blockquote>