RTC Forums
November 24, 2024, 07:33:24 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Calling remote functions in blocking mode not working in iOS  (Read 4820 times)
Christen
RTC Expired
*
Posts: 9


« on: May 11, 2012, 06:19:18 PM »

I´ve made a simple sample client to call a remote server following your instructios to write a blocking mode client in this forum.
The client works fine in Windows but fails in iOS.
The same client works fine in non blocking mode in both environments.
¿What is going wrong?

Best regards
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: May 11, 2012, 06:43:11 PM »

There are two ways you can get Client-side components on iOS to work in Blocking mode:

Option A: Make sure that the "rtcFMX_GUI" unit is in your projects "uses" clause (uses rtcFMX_GUI), or in the "uses" clause of a unit used by your Project (for example, the unit where your main form is implemented). This will allow the components to synchronize execution of code from background threads with the main thread on iOS, where thread synchronization is working differently than on Windows.

Option A: Set "Blocking=TRUE" and "MultiThreaded=FALSE" on the TRtcHttpClient component. This will make the component work in single-threaded blocking mode, which means that each "Post", "Execute" or "Call" method will be running in full blocking mode. No background threads, everything will be running in the main thread. In this operation mode, there is no need to synchronize threads, so it will give you the fastest results - and there is no requirement for the "rtcFMX_GUI" unit.

Best Regards,
Danijel Tkalcec
Logged
Christen
RTC Expired
*
Posts: 9


« Reply #2 on: May 11, 2012, 08:19:16 PM »

There are two ways you can get Client-side components on iOS to work in Blocking mode:

Option A: Make sure that the "rtcFMX_GUI" unit is in your projects "uses" clause (uses rtcFMX_GUI), or in the "uses" clause of a unit used by your Project (for example, the unit where your main form is implemented). This will allow the components to synchronize execution of code from background threads with the main thread on iOS, where thread synchronization is working differently than on Windows.

Option A: Set "Blocking=TRUE" and "MultiThreaded=FALSE" on the TRtcHttpClient component. This will make the component work in single-threaded blocking mode, which means that each "Post", "Execute" or "Call" method will be running in full blocking mode. No background threads, everything will be running in the main thread. In this operation mode, there is no need to synchronize threads, so it will give you the fastest results - and there is no requirement for the "rtcFMX_GUI" unit.

Best Regards,
Danijel Tkalcec

Thank you for the solution. It would be nice to include that information in the blocking remote function caling article of the quick start guide.

Best regards
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: May 12, 2012, 12:14:52 AM »

Since you are working on iOS Projects, you might be interested in this FAQ topic.

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.025 seconds with 16 queries.