On my application (i use DXE7), I use TIdTCPClient to receive messages from TIdTCPServer (VCL Application) when I put idthreadcomponent1.active:=true, the application works fine on windows, but it crashes on android(5.1.1)
Procedure TF_RestMain.SetConnectClientCmd();
begin
if RestCM.ServInfos.AcceptNotifServ then
BEGIN WorkingLBL.Text:='Connecton ...';//Label
with RestCM do
Try if IdTCPClient1.Connected then
IdTCPClient1.Disconnect;
IdTCPClient1.Port:=ServInfos.ServPort+1;
IdTCPClient1.Host:=ServInfos.HostAddr;
IdTCPClient1.Connect;
Except raise End;
END;
procedure TRestCM.IdTCPClient1Connected(Sender: TObject);
Begin //HERE CRASH WITHOUT ERROR MESSAGE
IdThreadComponent1.Active := true;
end;
procedure TRestCM.IdThreadComponent1Run(Sender: TIdThreadComponent);
var FMsg:string;
begin
FMsg:= IdTCPClient1.IOHandler.ReadLn();
if FMsg[1]'%' then F_RestMain.AddNotification (FMsg);
end;