Topic Path: Symbol Reference > Classes > TIdTCPConnection Class > TIdTCPConnection Methods > SendCmd Method > SendCmd Method (string, string)
ContentsIndexHome
PreviousUpNext
TIdTCPConnection.SendCmd Method (string, string)

Sends a command to the peer connection.

function SendCmd(
    AOut: string; 
    AResponse: string
): string; overload;
Parameters 
Description 
AOut 
Command to be sent to the server.
 
AResponse 
Response expected. 

string - Response for the command.

SendCmd is an overloaded function used to send the command specified in AOut to the peer connection. 

SendCmd uses IOHandler to write the command in AOut to the peer connection. 

AResponse indicates the response allowed for the command. 

SendCmd calls GetResponse to determine if the response from the peer connection is allowed. If the response is not allowed, an exception is raised during processing in GetResponse

When AResponse is contains -1, GetResponse is called with an empty array to indicate that any response code is permitted for the command. Otherwise, the value in AResponse is used to valid the response code. 

Use LastCmdResult to access the numeric and text portions of the response for the command.

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