function ReadLn(ATerminator: string; const ATimeout: Integer; AMaxLineLength: Integer): string; virtual;
Parameters
ATerminator: string = LF
End-of-line termination character or characters.
const ATimeout: Integer = IdTimeoutDefault
Time-out in milliseconds. Default value IdTimeoutInfinite.
AMaxLineLength: Integer = -1
Returns
String - Line read from the buffer.
Description
ReadLn is a function that returns a string containing a single line from the buffer maintained by TIdTCPConnection.
The optional ATerminator parameter indicates the end-of-line symbol for the particular protocol. If data is expected, and you do not need a custom end-of-line symbol, you can use the default ATerminator value (#0). ATerminator values include:
#0 - Default Line Feed (#10)
LF - Line Feed (#10)
CR - Carriage Return (#13)
EOL - End-of-line (Carriage Return + Line Feed)
If there is no terminator (ATerminator) in the buffer, ReadLn will read more bytes from the
TCP stack through the ReadFromStack method.
Use a custom time-out (ATimeout) value to change the number of milliseconds to wait for a response from the peer connection before a time-out occurs. The default value for ATimeout is IdTimeoutInfinite. See IdGlobal.pas for more information on constant timeout values.
ReadLn will return an empty string ('') if the peer connection is prematurely closed or a time-out occurs. When a timeout condition occurs in ReadLn, the ReadLnTimedOut property is set to True.