Internet Direct (Indy) Version 9.0.2 Beta
TIdTCPConnection.Capture
Reads data from the connection into the specified object.

procedure Capture(ADest: TObject; const ADelim: string; const AIsRFCMessage: Boolean);
Parameters
ADest: TObject
Storage for the captured data values.

const ADelim: string = '.'
Delimiter for captured data values. Default value is '.'.

const AIsRFCMessage: Boolean = True
Captured data is an RFC 822 message. Default value is True.

Description
Capture is a procedure used to read data from the connection into the destination specified by ADest. ADest must be an instance of either a TStrings descendant or a TStream descendant, or an EIdObjectTypeNotSupported exception with the constant message RSObjectTypeNotSupported will be raised when data is written to ADest.

ADelim is the delimiter used to determine if all data has been read from the connection. ADelim will appear in a line with no other data when all data has been captured. The default delimiter is '.', as used in most RFC-compliant protocols.

AIsRFCMessage indicates that Capture is reading an RFC 822 message where a line may start with the characters '..'. Capture will convert this character sequence to a single '.' character. A single '.' character in a line indicates the end of the RFC 822 message.

Capture calls BeginWork with the wmRead work mode before reading data from the connection. Capture calls ReadLn to retrieve data from the connection until the delimiter specified in ADelim is received. Each line is written to the ADest object reference upon receipt. Capture calls EndWork with the wmRead work mode when all data has been captured from the connection.