🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1761
From: Hanne B
Date: Wed, 08 Nov 2006 14:51
62 lines
2670 bytes
"Hans Galema" <notused@notused.nl> wrote in message 
news:4551be9b$1@newsgroups.borland.com...
> Hanne B wrote:
>
>> It doesn't happen in any of my lines but a short time after the code has 
>> been executed.
>
> Are you sure?
>
>> void __fastcall TForm1::ButtonDisconnectClick(TObject *Sender)
>> {
>>   if (AThread)
>>   {
>>     if (AThread->Connection &&
>>         AThread->Connection->ClosedGracefully == false)
>>         AThread->Connection->Disconnect();
>>
>>     AThread->StopMode = smTerminate;
>>     AThread->Stop();
>>   }
>> }
>
> I did not try your code yet. You could first try the following:
>
> void __fastcall TForm1::ButtonDisconnectClick(TObject *Sender)
> {
>   if (AThread)
>   {
>     if (AThread->Connection &&
>         AThread->Connection->ClosedGracefully == false
>        )
>         AThread->Connection->Disconnect();
>
>     if ( AThread )
> {
>     AThread->StopMode = smTerminate;
>     AThread->Stop();
> }
>     else
> ShowMessage ( "AThread gone");
>   }
> }
>
> Hans.
>



I have tried your code with ShowMessage("AThread gone")  - it didn't show 
the message (so AThread has not become NULL at that time).

I have put a message box in the bottom of the method - and seen that the 
exception occures before this message is shown.
And it also happens if I remove the part to termintate/stop the Thread.

So it must be the call AThread->Connection->Disconnect()  that cause the 
error - because the stream is still open / used.

How do I disconnect the client if the above cannot be used ?


Hanne
Technical Details
Message-ID: <4551ef09@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com> <4551ba0d$1@newsgroups.borland.com> <4551be9b$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
Reply-To: "Hanne B" <hb@aeromark.dk>
From: "Hanne B" <hb@aeromark.dk>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com> <4551ba0d$1@newsgroups.borland.com> <4551be9b$1@newsgroups.borland.com>
Subject: Re: Indy9 - BCB5 - FTP server - access violation errors
Date: Wed, 8 Nov 2006 15:51:49 +0100
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: 83.91.195.110
Message-ID: <4551ef09@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1162997513 83.91.195.110 (8 Nov 2006 06:51:53 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail