Daniel Eriksson wrote: >> Have you tried calling Abort on the data connection? > Do you mean like this? > > AFtpClient.DataSocket.Abort; > while AFtpClient.State <> ftpReady do > begin > Delay(1); > end; > > (note: Delay() is an improved version of Sleep() that I'm using).
That's bad practice, don't wait in a loop for async functions return, why don't you use appropriate events to control program flow? After DataSocket.Abort OnRequestDone should trigger a winsock error. > The above code seems to work, but is it 100% safe to use? I mean, why > use TFtpClient.AbortXfer if this one works for all FTP servers? AbortXfer is a FTP command, DataSocket.Abort or DataSocket.Close is just closing the data connection, anyway a server must handle this. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be