Trying to convert some code over from NSURLConnection and noticed that the timeouts are per-session, not per-task. In our existing code there are a few places where some requests are given longer timeouts then the others.
I see that in NSURLSession the timeouts are all session based. i.e one-size-fits all. There seem to be a couple of options to be able to fine-tune the timouts per-task:
- Use different sessions for each different timeout. Not pleasant and goes against the idea of having one session-per client-server pairing.
- Set the Session timeout for each task at task creation time. Not even sure this would work and if it did would need additional multithreading safeguards to ensure only one task at at time can be created.
Anyone else had to deal with this oversight?