Internet Direct (Indy) Version 9.0.1 Beta
TIdMessageClient.ProcessMessage
Loads and processes message headers and contents into a TIdMessage instance.

procedure ProcessMessage(AMsg: TIdMessage); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AStream: TStream); overload;
procedure ProcessMessage(AMsg: TIdMessage; const AFilename: string); overload;
Parameters
AMsg: TIdMessage
Message to receive header and contents.

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 perform the ReceiveHeader and ReceiveBody methods, 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.