Re: TimeOut

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

"Mark Williams" <mark@{removethis}skwirel.com> wrote in message
news:1B41020F8286E340mark@{removethis}skwirel.com...

> 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:

{code:delphi}
Result := TIdHTTP.Create(nil);
Result.ConnectTimeout := timeOut;
{code}

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)

Replies

In response to

TimeOut posted by Mark Williams on Wed, 24 Jun 2009