RTC Forums
November 24, 2024, 01:43:05 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: The network connection was lost on IOS 8  (Read 5325 times)
jorgen
RTC Expired
*
Posts: 20


« on: March 01, 2016, 09:27:30 AM »

I got this error
The network connection was lost on IOS8 ond IOS 9

It may be a bug in IOS:

http://www.pluchon.com/forum/viewtopic.php?id=36

http://www.pluchon.com/forum/viewtopic.php?id=36


workaround;

1)
Increase the timeout parameter of the server above 30 seconds. It looks like iOS is always behaving as if the server will keep the connection open for 30 seconds regardless of the value provided in the Keep-Alive header. (This can be done for Apache by setting the KeepAliveTimeout option.
2)
You can simply disable the keep alive mechanism for iOS clients based on the User-Agent of your app (e.g. for Apache: BrowserMatch "iOS 8\." nokeepalive in the mod file setenvif.conf)

How can I do this?



Logged
jorgen
RTC Expired
*
Posts: 20


« Reply #1 on: March 01, 2016, 09:35:35 AM »

second url was

http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #2 on: March 01, 2016, 10:38:25 AM »

1. Use TimeoutsOfAPI properties on the TRtcHttpServer component to configure time-out values for your Server. The same property is also available on the TRtcHttpClient component, where you can define time-out values for the Client. This allows you to set all available timeouts for the API being used.

2. If you are asking how to disable the HTTP keep-alive, because you want to force a new connection to be opened for each new request and closed immediately afterwards (as in the old HTTP/1.0 protocol), instead of allowing the same connection to be re-used for several requests (as in the new HTTP/1.1 protocol and the default behavior of RTC), you can set the FixupRequest.ForceOldHttp10 property on the TRtcHttpClient component to TRUE.

But ... please keep in mind that disabling HTTP keep-alive or using HTTP/1.0 (which does not have keep-alive) will have a BIG impact on your Clients performance, especially if you are sending a lot of short requests, because opening and new connection takes time, especially over the Internet.

If you are facing a problem with a Server closing a "keep-alive" connection after a period of inactivity, without your Client being notified, an alternative to using HTTP/1.0 or disabling the HTTP keep-alive completely is to use the Timeouts property on the TRtcHttpClient component to have your Client close its connection automatically after a period of inactivity, assuming the connection might already be closed by the Server. This way, you can re-use the same connection when multiple requests are being sent without much delay, but have the connection closed if there was no traffic for a while.

3. To make your Server work with all mobile devices over the internet (provided you are NOT writing a Proxy, but a normal Server), set the FixupRequest.RemovePrefix property on your TRtcHttpServer component to TRUE.

This helps avoid problems with mobile internet service providers who use HTTP Proxies and assume the receiver is also a HTTP Proxy (instead of a normal Server), injecting the protocol (http:// or https://) and domain name into the URI when forwarding requests.

If none of the above solves your issue, then I will need more detailed information about the problem and the way you are using the RTC SDK.

Best Regards,
Danijel Tkalcec
Logged
jorgen
RTC Expired
*
Posts: 20


« Reply #3 on: March 09, 2016, 03:44:53 PM »

It was a bug in my code.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #4 on: March 10, 2016, 11:31:37 AM »

Ok. Thanks for your feedback.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.027 seconds with 17 queries.