Arnau Font wrote:
> My service is multithreaded, as I receive different TCP/IP
> connections. And, 
> as it is a service, I have no forms, so I compiled the component (and
> its 
> related units) with the NOFORMS directive (in fact, I've copied the
> files 
> and deleted the lines accordingly).

Why? If NOFORMS is defined that code won't be compiled anyway.
> When I terminate the thread that creates the FTPClient, I do
> "FTPClient.Terminated:=true;" to stop the current transfer, in case
> it is 
> still active. 

Better call Abort directly. Since setting Terminated may work

> Can I check any property to know if the FTPClient is
> currently 
> connected?

Property FTPClient.Connected tells you whether the control connection
is connected or not. It doesn't check the data channel.
At any time you can check the underlaying TWSocket component directly,
for instance FtpClient1.DataSocket.State <> wsClosed does the same
on the datasocket as Connected on the control socket.

> Should I call FTPClient.QuitAsync before closing anything?

In order to cancel any transfers and to close any connection as fast
as possible call method Abort.
> Also, I'm having trouble with slow transmissions. When a download
> lasts more 
> than 20 minutes the component seems to freeze, and the component
> remains in 
> ftpWaitingResponse. It seems that it doesn't receive the confirmation
> (FServerSaidDone still remains at false). I suspect that, as the
> control 
> socket is idle all this time, some device closes it and I can't
> receive the 
> server confirmation, I only get the DataSocketGetSessionClosed event. 
> I'm behind an ISA Server, I suppose that it closes the control
> socket, as it 
> isn't sending anything. How can I avoid that?

In latest downloads there's a new public property KeepAliveSecs to
enable keepalive packets on the control socket, this should avoid
the connection from being closed on inactivity. 

Arno Garrels [TeamICS]

> Is there anything else I should take in consideration?
> Thanks!
> ____________________________________________________________________________
> ___
> Arnau Font Riera        IPS, S.L.                                 
> Tel. 93 
> 295 45 45
> Dpt. I+D                       Av. Francesc Cambó 14, 10è      Fax 93
> 295 45 
> 47
> [EMAIL PROTECTED]         08003 Barcelona
> <>
> ____________________________________________________________________________
> ___
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to