2

I need to call a web service (post) on every 30 seconds. For first 3-4 times it works fine , but after 3-4 hits it gives error :

Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSErrorFailingURLStringKey=My_URL, _kCFStreamErrorCodeKey=-4.

Please note that, Same web service hits from android app and postman then it works fine for everytime (no matter how many times you hit). I am using iphone device, I have also tried on simulator but still same issue. I have also checked my enitre code (check all values at run time before call web services) , all is fine. Any idea what's going wrong. Any suggestion will be great. Thanks in advance.

Ravi
  • 800
  • 2
  • 12
  • 28
  • this might due your internet connection – Milap Kundalia Mar 15 '16 at 08:44
  • Unfortunately, because this appears to be a bug in the underlying Foundation URL Loading System, there is no real way for AFNetworking to work around this issue. . check this link and post of matt ... https://github.com/AFNetworking/AFNetworking/issues/2314 – Bhavin Bhadani Mar 15 '16 at 08:45
  • possible duplicate of http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost – Milap Kundalia Mar 15 '16 at 08:46
  • @ Milap Kundalia , internet is stable and working 100 % I have confirmed. Furthermore ,This is not dublicate question, Because I have alreday tried many solutions like : **Restarting the simulator** (you have shared this link). which may resolve my this issue. But still facing same problem. That's why I have asked this question from my side. – Ravi Mar 15 '16 at 09:00
  • @Monusingh did you find the solution? I am facing the same issue :( – Robert TuanVu Oct 03 '16 at 06:57
  • @ Robert TuanVu , I have used latest AFNetworking and improved my code , and worked for me. Let you try also please. thanks. – Ravi Oct 03 '16 at 11:14

0 Answers0