🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1760
From: Hans Galema
Date: Wed, 08 Nov 2006 11:23
42 lines
1993 bytes
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.
Technical Details
Message-ID: <4551be9b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com> <4551ba0d$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
Date: Wed, 08 Nov 2006 12:23:45 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: Indy9 - BCB5 - FTP server - access violation errors
References: <4551ac92@newsgroups.borland.com> <4551ad3e$1@newsgroups.borland.com> <4551ba0d$1@newsgroups.borland.com>
In-Reply-To: <4551ba0d$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 145.98.201.248
Message-ID: <4551be9b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1162985115 145.98.201.248 (8 Nov 2006 03:25:15 -0700)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail