Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jan : Re: TIdCustomHTTPServer - Abandoned threads

www.cryer.info
Managed Newsgroup Archive

Re: TIdCustomHTTPServer - Abandoned threads

Subject:Re: TIdCustomHTTPServer - Abandoned threads
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 30 Jan 2007 12:58:07

"Mike B." <mbrickman@radsol.co.uk> wrote in message
news:1170160065.015713.299620@k78g2000cwa.googlegroups.com...

> To fix the problem I have set the ReadTimeOut to 5mins when
> the context is created - as follows:

Use the server's OnConnect event instead:

    procedure TForm1.IdHTTPServer1Conect(aContext: TIdContext)
    begin
        aContext.Connection.IOHandler.ReadTimeOut := 300000;
    end;

> This sort of works, but fires an assert trap in
> TIdCustomHTTPServer.DoExecute - Assert(not
IOHandler.ReadLnTimedOut).

Which is perfectly fine.  The exception will be handled by Indy
internally.

> This is rather irritating as assertions are difficult to handle as
> they are too unspecific.

You don't have to deal with the assertion yourself at all.  It is
inside of Indy's internal code, and will be handled accordingly.  The
only time you will ever see it is if you are running the code inside
of the debugger.  In which case, you can tell the debugger to ignore
it.

> It would be better if a timeout condition raised a specific
exception

It already throws an exception.  It doesn't matter what kind f
exception is being raised.

> which could then be trapped and handled as appropriate.

An assert is already trapped and handled appropriately.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive