Internet Direct (Indy)
Home
PreviousUpNext
TIdTCPConnection.SendCmd Method (string, SmallInt)

Sends a command to the peer connection.

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

SmallInt - 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.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.