Honestly I don't understand.
I just want to exchange some simple text, why is it so complicated

? On windows with delphi it was so easy, even on very old versions.
From client:
procedure TForm1.Button3Click(Sender: TObject);
begin
IdTCPClient1.Host := Edit1.Text;
IdTCPClient1.Connect;
IdTCPClient1.IOHandler.WriteLn('TRANSFERTFILE');
IdTCPClient1.IOHandler.WriteLn('dr.txt');
IdTCPClient1.IOHandler.WriteLn('contenu');
IdTCPClient1.Disconnect;
end;
On the server:
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
Cmd : String;
begin
with AContext.Connection.IOHandler do
begin
Test := ReadLn;
Cmd := Fetch(Test);
if Cmd = 'TRANSFERTFILE' then
begin
Test := ReadLn;
Memo1.Lines.Add(Fetch(Test));
Test := ReadLn;
Memo1.Lines.Add(Fetch(Test));
end;
end;
AContext.Connection.Disconnect;
end;
And I get this :
dr.txt
contenu
dr.txt
contenu
It is not logical I think