iPhone app gets into a state where network requests never complete

前端 未结 2 433
刺人心
刺人心 2021-01-01 19:57

Every so often, my iPhone app gets into a state where network requests always time out, even if other apps work fine (and can even access the same sites). This isn\'t obviou

相关标签:
2条回答
  • 2021-01-01 20:51

    There was a bug open about this at https://bugzilla.novell.com/show_bug.cgi?id=555439 and there were several attempts at resolving it. As of the last comment in the bug, it was presumed fixed but I guess if you are using MonoTouch 4.0.3 then there some cases that are not worked around.

    Basically, the problem is reflected in this other Stackoverflow question: iPhone 3G Connection Enabling

    What MonoTouch does to try and work around this issue is to call MonoTouch.Runtime.StartWWAN(Uri) which opens a dummy connection to the uri using an NSUrlConnection to force-wake the network interface. Then, MonoTouch goes back to using the BSD socket API inside the HttpWebRequest.

    0 讨论(0)
  • 2021-01-01 21:01

    Try setting the timeOutInterval property of the NSURLRequest used to make the call.

    0 讨论(0)
提交回复
热议问题