LNet demo working; own application not lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- mangakissa · 2014-12-12 13:20 I'm very confused. I noticed there are problems in my wince application when I use FTP from Indy. I heard a lot of LNET especially with WinCE. I downloaded and installed the LNet packages to my Lazarus 1.2.6 / FPC 2.6.4 Windows Vista. Run the FTP demo. This works fine. It connects, put files on (unix) server and disconnect without problems. now I created a very small demo to look if I get it right. To put a file to a FTP server you only need these commands: .connect(,21) .authenticate(,) .binary := true .connected .put() .disconnected(true) .connect fives met a true back, but when I check on .connected it gives false and will not put my file to a server. I really don't know why. As far as I know I do exactly what FTP demo applies. Please help me to connect the FTP. If FTP demo works, my simple application must also. ---------------------------------------------------------------------- rvk · 2014-12-12 14:12 As far as I can see the whole LNET is event driven and you don't wait for the ftp to be connected. (isn't using Synapse a lot easier  ) If you for example change your code to allow the event to take place you get a lot further: Code: [Select]  if ftp.Connect then   begin     repeat       Application.Processmessages;     until ftp.Connected;     // .... rest Of course you need to check for a timeout or make it possible to escape by key etc. The demo also does all this. ---------------------------------------------------------------------- mangakissa · 2014-12-15 10:58 Thanks rvk. I've got a connection, butt sending files is not so easy done. I can't get .statuset working. Now I have it (as a workaound) done this way Code: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   setconnection := false; end; procedure TForm1.FTPConnect(aSocket: TLSocket); begin   ftp.Authenticate(EUser.text,EPassword.text);   ftp.Binary := true;   ftp.ChangeDirectory('tmp'); end; procedure TForm1.Button1Click(Sender: TObject); var i : integer; begin   ftp.Host := EHost.text;   ftp.Port := 21;   ftp.Connect;   repeat      Sleep(100);      Application.ProcessMessages;   until (setconnection);   filesend      := false;   if ftp.Connected then      sendfile;   repeat      Sleep(100);      Application.ProcessMessages;   until ( filesend); end;