Re: "Connection Closed Gracefully"

Giganews Newsgroups
Subject: Re: "Connection Closed Gracefully"
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Mon, 24 Nov 2003

"Anchorman" <JesseN0SP…@davinci-mims.com> wrote in message
news:D4645049B287E240JesseN0SP…@davinci-mims.com...

>    FTP.Connect;
>    if not FTP.Connected then

That is redundant.  If Connect() does not connect, it will throw an
exception.

>      MessageBox(GetActiveWindow,'Unable to connect to FTP Site.','',MB_OK
+
> MB_ICONINFORMATION);

You would need to put that message into a try...except block.

> When ever it's finished, it gives me the message, "Connection
> Closed Gracefully".  This seems to happen only when I'm running
> it from the Delphi IDE.

Indy relies heavily on exceptions.  What you are seeing is simply an
exception being thrown internally.  However, because you are running inside
the IDE, the debugger is going to catch and display every exception that is
thrown, even internal ones that don't actually make it up to your code.
Simply press F9 to continue and the debugger will pass the exception back to
the application for normal handling.  If you want, you can add
EIdConnClosedGracefully (or EIdSilentException) to the debugger's list of
exceptions to ignore.

> What does this mean?

It means exactly what it was said - the socket was closed gracefully.

> Is this an error message?

No.  Have a look at the following article for a detailed explanation:

    Connection Closed Gracefully
  http://www.swissdelphicenter.ch/en/showarticle.php?id=1

Gambit

Replies

In response to

"Connection Closed Gracefully" posted by Anchorman on Mon, 24 Nov 2003