I am converting my application to use HTTPS and would like to avoid the cost of a handshake as much as possible while maintaining an open, long-term connection.
From reading web pages and other stack overflow responses, the NSURLConnection message appears should transparently keep the underlying socket open if the server responds with Connection: keep-alive and Keep-Alive: timeout = N.
However, I see that my connections remain open for only about 10 seconds. My Keep-Alive reaction is bigger than this. I also post Connection: keep-alive in my request headers.
Can anyone shed some light on this? I really don't want to use CFNetwork to achieve this.
source share