Re: Connection reset by peer

Giganews Newsgroups
Subject: Re: Connection reset by peer
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Mon, 22 Oct 2007

"Peter Ypenburg" <pet…> wrote in message

> My problem is that when ever I get a connection reset by
> peer error (Socket Error # 10054 ) it pops up an error
> message.

Which version of Indy are you using?

TIdFTP in Indy 9 is multi-threaded.  Any errors on the command connection
can be caught with a try..except, but the data connection runs in its own
thread that you can't hook into.  Any errors on the data connection would
simply terminate the transfer thread.  No popups are displayed.

TIdFTP in Indy 10 is not multi-threaded anymore.  The data connection runs
in the same thread as the command connection, so any errors on either
connection can be caught with try..except.  Again, no popups are displayed.

Are you running the code inside the IDE's debugger at the time of the error?
The debugger will always display an exception of any kind when it occurs
(unless you have that exception type listed in the debugger's list of
exceptions to ignore).

> Nowhere in my code have I got functionality to show any errors
> so I think that this is done in the Indy code.

Indy is a communications library.  It never displays any popups of its own.
It does, however, raise exceptions when needed.  Any popups that appear as a
result of a raised exception can only be getting shown inside an of
exception handler, whether that be your own handler or the RTL's internal

> The side effects of this error are even worse because the point
> of execution simply breaks out of my procedure not allowing me
> to do things like close my logfile or clean up some memory and so forth.

That is not possible.  A try..except block will always be executed.  This
still sounds like the debugger is catching the exception before your own
code does.



In response to

Connection reset by peer posted by Peter Ypenburg on Sat, 20 Oct 2007