Re: idTCPClient timeout

Giganews Newsgroups
Subject: Re: idTCPClient timeout
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Mon, 17 Sep 2007

"Halim Boumedjirek" <Hboumedjir…@idealss.com> wrote in message
news:D718C3EED735E340Hboumedjir…@idealss.com...

> I'm trying to figure out what's wrong with my
> idTCPClient1.Connect(500), this command should timeout
> after 500 ms but it seems like it's taking more than 10 seconds
> to timeout. Is there a way to make it timeout within the connect
> timeout 500 ms.

Are you using the TIdTCPClient in the main thread?  If so, is there a
TIdAntiFreeze component present as well?  TIdAntiFreeze can slow down
Connect() if there are pending messages in the main thread's message queue.
It also depends on how long the OS takes to close the socket when the
timeout is reached.  Blocking sockets do not support timed connects, so Indy
has to spawn a worker thread and then wait for that thread to terminate when
the socket API connect() function has exited.

Gambit

Replies

In response to

idTCPClient timeout posted by Halim Boumedjirek on Mon, 17 Sep 2007