Search code examples
delphidelphi-2010

TIdHTTPServer connection aborted


I have a http server application and I'm using TIdHTTPServer.

The problem I'm facing is that whenever a client is making a request(via a web browser) and the client refreshes/closes the page before the entire data is sent, the connection is aborted, now the server raises an exception, is there a way to catch and log this and also stop the exception message from showing?

Thank you for your time!


Solution

  • The exception that is thrown will only display a message box whilst running in the IDE.

    The TIdHTTPServer will catch the exception itself and handle it. It doesn't cause a problem. If you feel the need, you can log these exceptions use the IdHTTPServer.OnException event, otherwise they're essentially discarded.