Internet Direct (Indy) Version 9.0.1 Beta
TIdTCPConnection.GetResponse
Retrieves one or more response messages from the connection.

function GetResponse(const AAllowedResponses: array of SmallInt): SmallInt; virtual; overload;
function GetResponse(const AAllowedResponse: SmallInt): SmallInt; overload;
Parameters
const AAllowedResponses: array of SmallInt
An Integer response number expected.

Returns
SmallInt - The numeric response number.

Description
GetResponse is a overloaded SmallInt function that waits for a response message from the peer (such as greetings from a computer or command replies) and returns the numerical response number for the reply.

CmdResultDetails and CmdResult are cleared prior to retrieving any new response message(s). GetResponse will read all continuation response messages until the terminal response message is received, and adds the values to the CmdResultDetails property.

Use CmdResult to access the full text of the most recent response message, or CmdResultDetails to access multiple response messages.

GetResponse sets ResultNo to the three-digit numeric value from the most recent response message in CmdResult.

Finally, GetResponse calls CheckResponse using the values in ResultNo and AAllowedResponses to determine if the numeric response code is one of the numeric values allowed for the protocol action.