Topic Path: Symbol Reference > Classes > TIdCommandHandler Class > TIdCommandHandler Methods > Check Method
ContentsIndexHome
PreviousUpNext
TIdCommandHandler.Check Method

Handles dispatching and execution of the command for the command handler.

function Check(
    AData: string; 
    AContext: TIdContext
): boolean; virtual;
Parameters 
Description 
AData 
Data received from the peer connection.
 
AThread 
Thread of execution for the peer connection. 

Boolean - True on success.

Check is a Boolean function that is used to create, prepare, and dispatch a TIdCommand object instance used in association with the command handler. Check examines AData for optional CmdDelimiter and parameter values. 

Check creates a TIdCommand object instance used to represent the command handled by the command handler, and sets property values including the CommandHandler that created the object and the peer thread used for data and response messages. 

Check parses parameter values into the TIdCOmmand object when ParseParams is True. 

Check assigns the values in ReplyNormal as the default reply for the TIdCommand associated with the command handler. 

Check signals the OnCommand event handler to allow execution of actions for the command. 

If an exception occurs, Check updates the Reply from the command object to contain the value in ReplyExceptionCode and exception message text. Exception messages are then written to the peer thread connection. 

When the command object completes execution, values in Reply and Response are sent to the peer thread connection. If Disconnect is True, the peer thread connection is closed prior to exiting from the method.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.