Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Concerning IdTCPClient ReadTimeout


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Feb 29, 2016 12:21 PM Last Post By: Remy Lebeau (Te...
Jay Dee

Posts: 44
Registered: 11/22/10
Concerning IdTCPClient ReadTimeout  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 27, 2016 11:36 PM
Hi there everyone,

I have set the value of ReadTimeout once after the creation of my IdTCPClient object

Client := TIdTCPClient.Create(nil);
Client.ConnectTimeout := 7000
Client.ReadTimeout := 7000*2;


Do I also have to reset it everytime I'm reading data from the server (i;e for each data request) or is the initial setting enough? I ask because sometimes the requests do not trigger ReadTimeout.

Thanks,

JayDee
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Concerning IdTCPClient ReadTimeout  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 29, 2016 12:21 PM   in response to: Jay Dee in response to: Jay Dee
Jay wrote:

Do I also have to reset it everytime I'm reading data from the
server (i;e for each data request)

No.

is the initial setting enough?

Yes.

I ask because sometimes the requests do not trigger ReadTimeout.

ReadTimeout is a per-byte timeout. As long as the server is sending at least
1 byte before the 14s timeout elapses, no error will be reported. Use a
packet sniffer, like Wireshark, to verify. On the other hand, if the server
is actually not sending any data and no read timeout error is being reported,
then the code has likely been deadlocked and is no longer attempting to read
at all.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02