🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1770

Re: Indy9 - BCB5 - FTP server - access violation errors

#1770
From: Remy Lebeau (TeamB)
Date: Thu, 09 Nov 2006 10:51
34 lines
2482 bytes
"Hanne B" <hb@aeromark.dk> wrote in message
news:4552e3ba$1@newsgroups.borland.com...

> If they are interrupted while they are retrieving files (and I don't get
the
> disconnected event for the client), then they will stay "connected"
> and take up memory

Blocking sockets cannot detect abnormal disconnects in a timely manner.
TIdFTPServer in Indy 9 does not have enough hooks for you to customize the
connection's behavior, such as being able to automate the handling of
reading timouts.  The closest you can get is to set the
CommandHandlersEnabled property to False, then use the OnConnect event to
set the ReadTimeout property on a per-client basis, and then use the
OnExecute event to manually call ReadLn() and check the ReadLnTimedOut
property before then passing the received line to the CommandHandlers for
processing.  If a timeout occurs, you can disconnect the client.

> What exactly do you want me to do to disconnect the DataChannel first ?

TIdFTPServerThread has a DataChannelThread property.  Unfortunately, you do
not have access to the socket that it creates to transfer the data.  You
would have to change Indy's source and then recompile Indy in order to do
that.  Then you can disconnect the socket when needed, which will
effectively abort the transfer.

> how do I send an error message to the FTP client ?

TIdFTPServer automatically does that when the transfer thread fails to
transmit/receive data.


Gambit
Technical Details
Message-ID: <45530914$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4551ac92@newsgroups.borland.com> <4552371e$3@newsgroups.borland.com> <4552e3ba$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,942ca0ee33498431
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4551ac92@newsgroups.borland.com> <4552371e$3@newsgroups.borland.com> <4552e3ba$1@newsgroups.borland.com>
Subject: Re: Indy9 - BCB5 - FTP server - access violation errors
Date: Thu, 9 Nov 2006 02:51:01 -0800
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 69.169.4.232
Message-ID: <45530914$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1163069716 69.169.4.232 (9 Nov 2006 02:55:16 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail