Doubtful stuff in function TIdIOHandler.ReadLn

Giganews Newsgroups
Subject: Doubtful stuff in function TIdIOHandler.ReadLn
Posted by:  Tobias Giesen (tobi…@tgtools.de)
Date: Tue, 23 Aug 2005

Hi,

function TIdIOHandler.ReadLn has the parameter:

ATimeout: Integer = IdTimeoutDefault

If this parameter has then default value, IdTimeoutDefault, then
the function behaves identical to IdTimeoutInfinite. It does not
behave any different. Surely this is not correct.

As a quick solution, I am adding this at the beginning of
TIdIOHandler.ReadLn:

  if ATimeout = IdTimeoutDefault then
    ATimeout := FReadTimeOut;
  if ATimeout = IdTimeoutDefault then
    ATimeout := 60000;

Cheers,
Tobias

Replies