views:

40

answers:

0

I'm experiencing a weird problem and i wonder if anybody else has noticed this: I'm using NSURLConnection as it appears in apple's examples to get xml files from a certain server - pretty straight forward. And most of time it works, but sometimes it's just stuck after initialing and don't get into connection's delegate methods. I'm working with WiFi & 3G and the same server all the time. When it comes to didFailWithError i see that mostly it was a timeout error. When I enter same link in Safari it takes a second to bring data. And after another trial I can access the link. What might be the reason for such a weird behavior? How can I improve it? What is the role of cache policy with NSURLConnection?

Thanks,

Nava

UPDATE: Seems, that I can define the problem better. The server processes many requests. When I connect it assigns me probably kind of a session id. When there is a problematic request I cannot access any url with the same session id, since the server is busy for my session id with trying to bring me an answer. The question now where this session should be cancelled? On my side or on the server side. Since I don't have any experience of working with servers may be there are some server side guys that can shed some light?

TIA