I'm converting my app to use HTTPS and would like to avoid the handshake cost as much as possible by keeping open a long-lived connection.
From reading the web and other answers on stack overflow it appears NSURLConnection should transparently keep the underlying socket open if the server responds with Connection: keep-alive and Keep-Alive: timeout=N.
However I am seeing that my connections are only kept open for around 10 seconds. My Keep-Alive response is set to much more than this. I am also sending Connection: keep-alive in my request headers.
Can anyone shed some light on this? I really don't want to have to use CFNetwork to achieve this.