3

In my app I'm using MKNetworkKit to make requests to my server and also make direct calls to Facebook using Facebook SDK. Sometimes (once in a few days) I get an odd issue: all network requests from my app stop working (both to my server and Facebook). I can't figure out what steps exactly cause this. When I have the issue I check other apps / Safari from my phone and internet connection is OK. If I close my app, wait for a couple of minutes and open it again then everything goes back to normal. I'm using WiFi for testing. What can cause this?

It seems to be exactly like in this question: iPhone app gets into a state where network requests never complete , although I don't use MonoTouch.

UPDATE: I do receive callbacks from MKNetworkKit saying "Request timeout" (I have 10 seconds request timeout in MKNetworkKit settings). And I don't receive callbacks from Facebook.

Community
  • 1
  • 1
andr111
  • 2,982
  • 11
  • 35
  • 45
  • Normal NSURLConnections time out after 1 min (default) or at some other time if you specify one. That said, it seems that POST requests get 4 minute timeouts (!!!) and they ignore your setting. I don't have the reference handy, but its here on the site. It would be useful to know - did the connection succeed, but the data transfer stall? – David H Aug 04 '12 at 00:11
  • More clarification is needed. My best guess would be that you are making the requests on a thread that doesn't last long enough for the delegate callbacks to succeed. – mamackenzie Aug 04 '12 at 00:15
  • @David, is it possible that a URLConnection doesn't get closed and it can't open a new one? Is there a limit on how many URLConnections I can open? – andr111 Aug 04 '12 at 13:00
  • @michael_mackenzie, how is it possible then that sometimes all requests from my app are working and sometimes they all stop working? – andr111 Aug 04 '12 at 13:01
  • 10 second timeout is way to short!!! – David H Aug 04 '12 at 13:02
  • Yes, but 10 timeout is definitely not the reason of the issue. Any ideas what can cause this? – andr111 Aug 04 '12 at 17:30

0 Answers0