title: CFNetwork unexpectedly closes http connection
body: <p>I am facing strange issue with <code>CFNetwork</code> on iOS simulator and on iOS device.</p>
  
  <p>I am sending HTTP requests to remote server. Sometimes, everything works correctly. But sometimes <code>CFNetwork</code> opens a socket to remote server, sends http request in one packet and then it sends FIN packet immediately (after about 1ms).</p>
  
  <p>I don't see this issue on Mac OS X, where I run similar code.</p>
  
  <p>Stream is created with <code>CFReadStreamCreateForStreamedHTTPRequest()</code> and it is put to <code>CFRunLoop</code>. If this issue occurs, then run-loop reports <code>kCFStreamEventOpenCompleted</code> and subsequently it reports <code>kCFStreamEventErrorOccurred</code> with ENOTCONN as an error. </p>