How to disable keep-alive when using NSURLConnection?
How to disable keep-alive when using NSURLConnection?
- Subject: How to disable keep-alive when using NSURLConnection?
- From: Nava Carmon <email@hidden>
- Date: Sun, 30 May 2010 22:47:02 +0300
Hi,
I have an iphone application, that presents the data that comes as an xml files, which I fetch from a various urls on the same server. There are problematic urls, that when I try to reach them from safari or from within the application give an error - mostly timeout error.
When I initialize the NSURLConnection I define a timeout in my NSURLMutableRequest in order not to stuck the GUI and let the user to work with application. On timeout I get didFailWithError in NSURLConnectionDelegate and show a message that there was not response from the server and the user can continue working. The matter is that the connection or underlying socket somehow is preserved and the connection with the server is not closed. So when I try to get another url from the same server I can't reach it since the server is still stuck with the previous problematic request!
Ffrom the other device or the browser I can reach urls, that are not reachable after problematic request on my device, simply because they open another socket to the same server.
The question is how do I totally close (force closing) the problematic connection, that is stuck till the server will "get out" of this unsuccessful fetch? I tried close connection and cancel connection, but seems these APIs do nothing :(. I understand that NSURLConnection uses keep-alive value for connection in order to re-use the socket. How do I disable it? I'm using "GET" http method to retrieve the data.
Thanks in advance,
Nava Carmon
email@hidden
"Think good and it will be good!"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden