Internet Direct (Indy)
Home
PreviousUpNext
TIdIOHandler.ReadLn Method ()

Reads a line from the internal buffer for the IOHandler.

Pascal
function ReadLn: string; overload;

String - Line read from the buffer.

ReadLn is an overloaded string function used to read a single line of text from values received from the peer connection for the IOHandler. 

ReadLn is a String function that returns a a single line from the input buffer maintained for the IOHandler. This variant of the ReadLn method uses the LF character as the end-of-line delimiter, and calls an overloaded variant of the method. 

ReadLn retrieves data from InputBuffer until the end-of-line sequence is located, the maximum line length is exceeded, the socket connection is closed, or a timeout occurs. If there is not enough data to satisfy the request, ReadLn calls CheckForDisconnect to update the IOHandler status and reads data from the data source for the IOHandler connection. 

ReadLn will return an empty string ('') if the peer connection is prematurely closed or a time-out occurs. If a timeout condition occurs in ReadLn, the ReadLnTimedOut property is set to True. 

ReadLn can raise an EIdReadLnMaxLineLengthExceeded exception when the position of the end-of-line sequnce in the InputBuffer is greater than the maximum line length allowed for an IOHandler using the value maException in MaxLineAction

All ATerminator characters in the return value for ReadLn (including CR and LF characters) are removed prior to exiting from the method.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.