RTC Forums
November 24, 2024, 04:59:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: WaitForCompletion iOS and AutoConnect = True  (Read 6364 times)
ISIGest
RTC Expired
*
Posts: 121


« on: July 27, 2015, 12:58:06 PM »

Hi, Danijel I've found a problem.
If you have an TRthHTTPClient connected with a TRtcClientModule with this config:

Code:
with HTTPClient do begin
  AutoConnect := True;
  MultiThread := True;
end;

and..

Code:
with ModuleClient do begin
  Client := HTTPClient;
  AutoSession := True;
  AutoSessionPing := 10;
  ModuleFileName := '/$REMOTE';
end;

if you try to make a function call

Code:
  with Prepare('Login') do
  begin
    asString['user'] := AUser;
    asString['passwd'] := APass;
  end;
  ModuleClient.Call(resLogin);
  ModuleClient.WaitForCompletionEx(True);

DoWaitForCompletion(True) exit immediately with "wait_Error", this because when ModuleClient.Call will executed the HTTPClient is not connected I suppose.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: July 27, 2015, 05:12:29 PM »

Are you using the rtcFMX.GUI unit somewhere in your Project?
That unit is required by all FireMonkey Applications to make Synchronization with the Main Thread, blocking calls and the WaitForCompletion method work.

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


« Reply #2 on: July 27, 2015, 05:39:33 PM »

With or without is same
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: July 27, 2015, 05:44:14 PM »

This might sound like a stupid question, but ... is the TRtcHtttpClient component fully configured to connect to a Server and is that Server running?
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #4 on: July 27, 2015, 05:48:25 PM »

Smiley
If I run the application win Win32 all work fine...but in iOS or Android no
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #5 on: July 27, 2015, 05:51:11 PM »

Which Delphi version are you using?
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #6 on: July 27, 2015, 05:52:25 PM »

XE8.1
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #7 on: July 27, 2015, 05:57:51 PM »

Provided the Server is accessible from a mobile device, then using the rtcFMX.GUI unit somewhere in your Project should do the trick. If it doesn't, then please send me an E-Mail with an Example Project (including Client and Server source code) to demonstrate the issue and I will take a closer look:


Best Reagrds,
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 17 queries.