Indy 9
TIdMessageClient
Hierarchy, Properties, Methods, Events, See Also, Unit: IdMessageClient
Implements a message client.
TIdMessageClient = class(TIdTCPClient)
Unit
IdMessageClient
Description
TIdMessageClient is a TIdTCPClient descendant that implements a generic message client. TIdMessageClient can read and write Internet messages compliant with the RFC 822 message specification.

TIdMessageClient provides methods and properties needed to handle transmission and receipt of both the headers and the body for an Internet message, including line folding.


TIdMessageClient.MsgLineFold
TIdMessageClient, See Also
Identifies the line fold character sequence.
property MsgLineFold: string;
Description
MsgLineFold is a String property that identifies the line fold character sequence inserted at the beginning of a folded line. The default value for MsgLineFold is TAB (Decimal 9), as assigned in the Create constructor.

TIdMessageClient.MsgLineLength
TIdMessageClient, See Also
Maximum line length.
property MsgLineLength: integer;
Description
MsgLineLength is an Integer property that specifies the maximum length of a header line. If the length is exceeded, the header line is folded. The default value for MsgLineLength is 79, as assigned in the Create constructor.

TIdMessageClient.Create
TIdMessageClient
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance. Create relies on the inherited create constructor, and initializes the following property values:


TIdMessageClient.ProcessMessage
TIdMessageClient, See Also
Loads and processes message headers and contents into a TIdMessage instance.
procedure ProcessMessage(AMsg: TIdMessage; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AStream: TStream; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AFilename: string; AHeaderOnly: Boolean = False); overload;
Parameters
AMsg: TIdMessage
Message to receive header and contents.
const AStream: TStream
Stream containing headers and contents to be loaded.
const AFilename: string
File containing headers and contents to be loaded.
Description
ProcessMessage is an overloaded method in TIdMessageClient that implements loading and processing of message headers and contents using socket-, stream-, or file-based IOHandlers.

The default implementation of ProcessMessage uses the IOHandler assigned to the client connection to receive the header and body of the message, and stores data in the message instance specified in AMsg.

The stream-based variant of ProcessMessage creates a TIdIOHandlerStream instance that can be used to load data from the stream specified in AStream into AMsg. The TIdIOHandlerStream instance is freed prior to exiting from the method.

The file-based variant of ProcessMessage creates a TFileStream used to access message data in the file specified by AFilename, and calls the stream-based variant of ProcessMessage to load message data into AMsg. The TFileStream instance is freed prior to exiting from the method.


TIdMessageClient.ProcessMessage
TIdMessageClient, See Also
Loads and processes message headers and contents into a TIdMessage instance.
procedure ProcessMessage(AMsg: TIdMessage; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AStream: TStream; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AFilename: string; AHeaderOnly: Boolean = False); overload;
Parameters
AMsg: TIdMessage
Message to receive header and contents.
const AStream: TStream
Stream containing headers and contents to be loaded.
const AFilename: string
File containing headers and contents to be loaded.
Description
ProcessMessage is an overloaded method in TIdMessageClient that implements loading and processing of message headers and contents using socket-, stream-, or file-based IOHandlers.

The default implementation of ProcessMessage uses the IOHandler assigned to the client connection to receive the header and body of the message, and stores data in the message instance specified in AMsg.

The stream-based variant of ProcessMessage creates a TIdIOHandlerStream instance that can be used to load data from the stream specified in AStream into AMsg. The TIdIOHandlerStream instance is freed prior to exiting from the method.

The file-based variant of ProcessMessage creates a TFileStream used to access message data in the file specified by AFilename, and calls the stream-based variant of ProcessMessage to load message data into AMsg. The TFileStream instance is freed prior to exiting from the method.


TIdMessageClient.ProcessMessage
TIdMessageClient, See Also
Loads and processes message headers and contents into a TIdMessage instance.
procedure ProcessMessage(AMsg: TIdMessage; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AStream: TStream; AHeaderOnly: Boolean = False); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AFilename: string; AHeaderOnly: Boolean = False); overload;
Parameters
AMsg: TIdMessage
Message to receive header and contents.
const AStream: TStream
Stream containing headers and contents to be loaded.
const AFilename: string
File containing headers and contents to be loaded.
Description
ProcessMessage is an overloaded method in TIdMessageClient that implements loading and processing of message headers and contents using socket-, stream-, or file-based IOHandlers.

The default implementation of ProcessMessage uses the IOHandler assigned to the client connection to receive the header and body of the message, and stores data in the message instance specified in AMsg.

The stream-based variant of ProcessMessage creates a TIdIOHandlerStream instance that can be used to load data from the stream specified in AStream into AMsg. The TIdIOHandlerStream instance is freed prior to exiting from the method.

The file-based variant of ProcessMessage creates a TFileStream used to access message data in the file specified by AFilename, and calls the stream-based variant of ProcessMessage to load message data into AMsg. The TFileStream instance is freed prior to exiting from the method.


TIdMessageClient.SendMsg
TIdMessageClient
Sends message headers and body on the client connection.
procedure SendMsg(AMsg: TIdMessage; const AHeadersOnly: Boolean = False); virtual;
Parameters
AMsg: TIdMessage
Message to be sent by the client.
AHeaderOnly
Client will write only headers. Default value is False.
Description
SendMsg is a virtual procedure in TIdMessageClient that performs the processing required to send the message headers and optional message parts from the message specified in AMsg using the message client. The default implementation of SendMsg calls SendHeader to write the message headers in AMsg. When AHeaderOnly is False, SendMsg also writes a blank separator line signalling the end of message headers, and calls SendBody to send the contents of the message body or message parts.

Descendant classes may override the default SendMsg behavior to implement protocol specific message transmission requirements.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.