Re: TimeOut

Giganews Newsgroups
Subject: Re: TimeOut
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Wed, 24 Jun 2009

"Mark Williams" <mark@{removethis}> wrote in message

> Each time I run this it bums out

What do you mean exactly?  Please be more specific.

> What I would like to happen is that after 15 seconds if a connection
> is not established then my post, get etc functions will terminate.

Use the ConnectTimeout property for that instead:

Result := TIdHTTP.Create(nil);
Result.ConnectTimeout := timeOut;

The ReadTimeout property does not apply until after the connection is
established and data is actually being read.

> Also, is there some event I should be handling or a particular response
> code I should be looking for?

TIdHTTP will raise an exception is a response code indicates an error.

Remy Lebeau (TeamB)


In response to

TimeOut posted by Mark Williams on Wed, 24 Jun 2009