RTC Forums
November 01, 2024, 09:23:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Connection Timeout on Android  (Read 4698 times)
ISIGest
RTC Expired
*
Posts: 121


« on: March 26, 2015, 10:18:32 AM »

How can I specific the connection timeout on Android?
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: March 26, 2015, 12:16:58 PM »

Blocking sockets API for Android (used for TCP/IP communication by RTC) does NOT have options for manually setting a connection timeout. Only sending and receiving timeouts can be configured by using the TimeoutsOfAPI ReceiveTimeout and SendTimeout properties on the TRtcHttpClient component.

Best Regards,
Danijel Tkalcec
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #2 on: March 27, 2015, 08:05:51 AM »

Oh yes I've setted it but with an HttpCLient.AutoConnect := True the connection stay busy for a long time Sad
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: March 27, 2015, 08:17:50 AM »

Unfortunately, the time it takes for a connection to get opened is not under our control and the connect timeout period is controlled at the OS level, but I don't think a long timeout should be an issue. The problem would be if you would use too short timeouts, which would interrupt the connection process before it had enough time to get completed. Please note that mobile devices are usually working through mobile networks with high latency, because of which the time it takes for a connection to get opened will usually be much longer than on desktop machines, so the timeout values set up at the OS level will also be higher by default than on desktop machines.

Best Regards,
Danijel Tkalcec
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #4 on: March 27, 2015, 09:08:48 AM »

The only method is to manage a custom CallFunction method of TModuleClient that start a TTimer to check connection state.
If when TTimer is fired the HTTPClient property IsConnecting is true then I call DisconnectNow(True) method.
Thanks
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.023 seconds with 17 queries.