Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jul : Catching Connection Closed Gracefully

www.cryer.info
Managed Newsgroup Archive

Catching Connection Closed Gracefully

Subject:Catching Connection Closed Gracefully
Posted by:"Eric" (er..@example.com)
Date:Fri, 27 Jul 2007 17:47:30

Hello,

I have a TidTCPServer and a TidFTPServer.  I am testing various
scenarios that might happen in the field and I have come across this one
that I do not yet understand.

In case it matters, I am using Madexcept, indy 9 and BDS 2006

I have an OnExecption handler for both servers.  When I have both a
socket to the server open as well as an active ftp download, I am
killing the client (to ensure my app can handle it.)

In the TidTCPServer Onexception handler, I get a Socket error #10054.
(As I expected)

In the TidFTPServer Onexception handler, I get a Connection Closed
Gracefully. (Again, as I expected)

However, I then get a Madexcept exception popup with Connection Closed
Gracefully.  It's indicating TidTCPCOnnection.CheckForDisconnect in the
TidDataChannelThread as the source of the exception.  Why is my
Onexception handler able to catch this?

I checked both of my onExeption handlers and I am not re-raising the
exception.


Thanks.

Replies:

www.cryer.info
Managed Newsgroup Archive