On Dec 1, 2007, at 13:36, Arno Garrels wrote:

> Have you got any exception that was raised from TWSocket internaly?
> I mean outside of your handler?

Well, I noticed the issue because my handler raised an unhandled 
exception and the application then behaved in a strange manner because 
it was never caught (just absorbed by ASyncReceive).  But then looking 
deeper, I found that at least SmtpProt and FtpProt *can* raise 
exceptions in the WSocketDataAvailable event (not that they have).  In 
particular, the obvious exception they raise is if the FNext pointer is 
NULL and its processing ExecAsync.

Admittedly that should never happen, but ignoring it is just asking for 
trouble (which is why I think Francois added the check and the 
exception there).  Also, the buffer manipulations performed there could 
theoretically fail, and an exception would not be caught, yet the 
component would be in a strange state.

Perhaps wrapping those handlers in a try..except block would be better.

        dZ.

-- 
        DZ-Jay [TeamICS]
        http://www.overbyte.be/eng/overbyte/teamics.html

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to