RTC Forums

Subscription => Support => Topic started by: ISIGest on July 27, 2015, 12:58:06 PM



Title: WaitForCompletion iOS and AutoConnect = True
Post by: ISIGest 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.


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: D.Tkalcec (RTC) 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


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: ISIGest on July 27, 2015, 05:39:33 PM
With or without is same


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: D.Tkalcec (RTC) 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?


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: ISIGest on July 27, 2015, 05:48:25 PM
:)
If I run the application win Win32 all work fine...but in iOS or Android no


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: D.Tkalcec (RTC) on July 27, 2015, 05:51:11 PM
Which Delphi version are you using?


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: ISIGest on July 27, 2015, 05:52:25 PM
XE8.1


Title: Re: WaitForCompletion iOS and AutoConnect = True
Post by: D.Tkalcec (RTC) 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:
(http://www.realthinclient.com/supportmail.gif)

Best Reagrds,
Danijel Tkalcec